#!/usr/bin/env python3 import os.path from idb import Article, DocumentCreator, tzo_urls from idb.util import name_from_url if __name__ == '__main__': for url in tzo_urls: name = name_from_url(url) orig = Article.from_markdown_file(os.path.join(os.path.dirname(__file__), 'tzo', f'{name}-ru.txt'), with_title=False) trans = Article.from_markdown_file(os.path.join(os.path.dirname(__file__), 'tzo', f'{name}-en.txt'), with_title=False) doc = DocumentCreator() doc.create(orig, trans, os.path.join(os.path.dirname(__file__), f'{name}.odt'))