diff --git a/fsmi_fsr/actions.py b/fsmi_fsr/actions.py index ec3cc42..0b94105 100644 --- a/fsmi_fsr/actions.py +++ b/fsmi_fsr/actions.py @@ -6,7 +6,8 @@ import datetime import pytz from dateutil import parser as dateutilparser -def clean_data(): + +def clean_data(config): open(config["top_mbox_file"], 'w').close() @@ -18,10 +19,10 @@ def clean_data(): if "file" in top and os.path.isfile(top["file"]): os.remove(top["file"]) -def read_db(): +def read_db(config): subprocess.run(["helpers/read_db.sh"], check=True) -def read_topmails(): +def read_topmails(config): in_mbox = mailbox.Maildir(config["top_inbox_maildir"]) out_mbox = mailbox.mbox(config["top_mbox_file"]) @@ -45,5 +46,5 @@ def read_topmails(): out_mbox.close() -def compile_presentation(): +def compile_presentation(config): subprocess.run(["helpers/compile_presentation.sh"], check=True) diff --git a/helpers/generate.py b/helpers/generate.py index 1f67c12..03ec44f 100755 --- a/helpers/generate.py +++ b/helpers/generate.py @@ -130,6 +130,7 @@ def main(rawargs=None): parser.add_argument("--date") args = parser.parse_args(rawargs) + global config config = util.get_config(util.get_normalized_config_path(args.config)) if args.print_config: diff --git a/helpers/sequencer.py b/helpers/sequencer.py index f4946ca..6deb36a 100755 --- a/helpers/sequencer.py +++ b/helpers/sequencer.py @@ -19,7 +19,7 @@ class BuiltinActions: def dispatch(action, args=[]): if package_actions and action in dir(package_actions): - getattr(package_actions, action)(*args) + getattr(package_actions, action)(config, *args) elif action in dir(BuiltinActions): getattr(BuiltinActions, action)(*args) elif action in config["sequencer"]: