26 lines
564 B
Python
26 lines
564 B
Python
import argparse
|
|
import logging
|
|
from pathlib import Path
|
|
|
|
from . import format_messages, merge_adjacent_messages, parse_messages_in_chat_folder
|
|
|
|
|
|
def parse_args():
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument('path', type=Path)
|
|
return parser.parse_args()
|
|
|
|
|
|
def main():
|
|
logging.basicConfig()
|
|
logging.getLogger().setLevel('INFO')
|
|
args = parse_args()
|
|
|
|
messages = parse_messages_in_chat_folder(args.path)
|
|
messages = merge_adjacent_messages(messages)
|
|
print(format_messages(messages))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|