configuration: the cache folder can now be specified in the configuration file
This commit is contained in:
@@ -15,7 +15,7 @@ def hist_cmd(args: argparse.Namespace, config: Config) -> None:
|
||||
tags_not=args.exclude_tags,
|
||||
question_contains=args.question,
|
||||
answer_contains=args.answer)
|
||||
chat = ChatDB.from_dir(Path('.'),
|
||||
chat = ChatDB.from_dir(Path(config.cache),
|
||||
Path(config.db),
|
||||
mfilter=mfilter)
|
||||
chat.print(args.source_code_only,
|
||||
|
||||
@@ -84,7 +84,7 @@ def question_cmd(args: argparse.Namespace, config: Config) -> None:
|
||||
mfilter = MessageFilter(tags_or=args.or_tags if args.or_tags is not None else set(),
|
||||
tags_and=args.and_tags if args.and_tags is not None else set(),
|
||||
tags_not=args.exclude_tags if args.exclude_tags is not None else set())
|
||||
chat = ChatDB.from_dir(cache_path=Path('.'),
|
||||
chat = ChatDB.from_dir(cache_path=Path(config.cache),
|
||||
db_path=Path(config.db),
|
||||
mfilter=mfilter)
|
||||
# if it's a new question, create and store it immediately
|
||||
|
||||
@@ -8,7 +8,7 @@ def tags_cmd(args: argparse.Namespace, config: Config) -> None:
|
||||
"""
|
||||
Handler for the 'tags' command.
|
||||
"""
|
||||
chat = ChatDB.from_dir(cache_path=Path('.'),
|
||||
chat = ChatDB.from_dir(cache_path=Path(config.cache),
|
||||
db_path=Path(config.db))
|
||||
if args.list:
|
||||
tags_freq = chat.msg_tags_frequency(args.prefix, args.contain)
|
||||
|
||||
Reference in New Issue
Block a user