#!/usr/bin/python3 import os import sys import logging import wikifolio import wikifolio.rss import os logging.basicConfig(level=logging.INFO) if len(sys.argv) == 2 and os.path.exists(sys.argv[1]): filename = sys.argv[1] name = os.path.basename(filename) name, _ = os.path.splitext(name) cert = wikifolio.get_id_from_name(name) comments = wikifolio.get_comments(cert) with open(filename, "w") as f: f.write(wikifolio.rss.dump(cert, comments))