33 lines
745 B
Python
Executable File
33 lines
745 B
Python
Executable File
#!/usr/bin/python3
|
|
import mailbox
|
|
import jinja2
|
|
import email.header
|
|
import email.utils
|
|
import yaml
|
|
import datetime
|
|
import sys, os
|
|
import pypandoc
|
|
import argparse
|
|
import quopri
|
|
from pprint import pprint
|
|
|
|
CONFIG_FILE = "generator.conf"
|
|
|
|
if __name__ == "__main__":
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("--config", default=CONFIG_FILE)
|
|
args = parser.parse_args()
|
|
|
|
config = yaml.full_load(open(args.config))
|
|
|
|
open(config["top_mbox_file"], 'w').close()
|
|
|
|
|
|
for top in config["pre_tops"]:
|
|
if "file" in top and os.path.isfile(top["file"]):
|
|
os.remove(top["file"])
|
|
|
|
for top in config["post_tops"]:
|
|
if "file" in top and os.path.isfile(top["file"]):
|
|
os.remove(top["file"])
|