1
0
libpurple-to-markdown/libpurple_to_markdown/__main__.py

26 lines
564 B
Python
Raw Normal View History

2024-10-25 23:12:30 +00:00
import argparse
2024-10-25 23:30:51 +00:00
import logging
from pathlib import Path
2024-10-26 11:47:39 +00:00
from . import format_messages, merge_adjacent_messages, parse_messages_in_chat_folder
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-26 11:47:39 +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 23:12:30 +00:00
messages = parse_messages_in_chat_folder(args.path)
messages = merge_adjacent_messages(messages)
print(format_messages(messages))
2024-10-26 11:47:39 +00:00
if __name__ == '__main__':
main()