1
0
libpurple-to-markdown/libpurple_to_markdown/__main__.py
2024-10-26 13:47:39 +02:00

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()