add helper scripts
This commit is contained in:
32
clean_data.py
Executable file
32
clean_data.py
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/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"])
|
||||
Reference in New Issue
Block a user