hist_cmd: added module 'test_hist_cmd.py'

This commit is contained in:
2023-09-29 18:53:02 +02:00
parent 811b2e6830
commit e19c6bb1ea
2 changed files with 63 additions and 3 deletions
+1 -3
View File
@@ -29,7 +29,7 @@ def convert_messages(args: argparse.Namespace, config: Config) -> None:
m.file_path = m.file_path.with_suffix('')
chat.msg_write(msgs)
# read all messages with the current default suffix
msgs = chat.msg_gather(loc='disk', glob='*{msg_suffix}')
msgs = chat.msg_gather(loc='disk', glob=f'*{msg_suffix}')
# make sure we converted all of the original messages
for mid in msg_ids:
if not any(mid == m.msg_id() for m in msgs):
@@ -41,8 +41,6 @@ def convert_messages(args: argparse.Namespace, config: Config) -> None:
if m.file_path and m.file_path.suffix != msg_suffix:
m.rm_file()
print(f"Successfully converted {len(msg_ids)} messages.")
if len(msgs):
print(f"Deleted {len(msgs)} messages with deprecated suffixes.")
def print_chat(args: argparse.Namespace, config: Config) -> None: