2024-10-25 23:12:30 +00:00
|
|
|
import argparse
|
2024-10-25 23:30:51 +00:00
|
|
|
import logging
|
2024-10-25 22:34:53 +00:00
|
|
|
from pathlib import Path
|
|
|
|
|
2024-10-25 23:12:30 +00:00
|
|
|
from . import (parse_messages_in_chat_folder, merge_adjacent_messages,
|
|
|
|
format_messages)
|
2024-10-25 22:34:53 +00:00
|
|
|
|
2024-10-25 23:12:30 +00:00
|
|
|
def parse_args():
|
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument('path', type=Path)
|
|
|
|
return parser.parse_args()
|
2024-10-25 22:34:53 +00:00
|
|
|
|
|
|
|
def main():
|
2024-10-25 23:30:51 +00:00
|
|
|
logging.basicConfig()
|
|
|
|
logging.getLogger().setLevel('INFO')
|
2024-10-25 23:12:30 +00:00
|
|
|
args = parse_args()
|
2024-10-25 22:34:53 +00:00
|
|
|
|
2024-10-25 23:12:30 +00:00
|
|
|
messages = parse_messages_in_chat_folder(args.path)
|
|
|
|
messages = merge_adjacent_messages(messages)
|
|
|
|
print(format_messages(messages))
|
2024-10-25 22:34:53 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|