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

21 lines
496 B
Python
Raw Normal View History

2024-10-25 23:12:30 +00:00
import argparse
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 23:12:30 +00:00
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('path', type=Path)
return parser.parse_args()
def main():
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))
if __name__ == '__main__':
main()