diff --git a/default.toml b/default.toml index 67577dd..23b2f92 100644 --- a/default.toml +++ b/default.toml @@ -1,12 +1,12 @@ [config] # twitter account name without '@' -twitter_account = "unrealengine" +twitter_account = "" # Domain name of Mastodon instance -mastodon_instance = "m" +mastodon_instance = "" # Mastodon username (login email address) -mastodon_user = "u" +mastodon_user = "" [options] # Download videos from twitter and upload them on Mastodon diff --git a/twoot.py b/twoot.py index 688cef9..032c386 100755 --- a/twoot.py +++ b/twoot.py @@ -159,8 +159,6 @@ def substitute_source(orig_url): logging.debug("Checking domain %s for substitution ", domain) - logging.debug(TOML) - # Handle twitter twitter_subst = TOML["options"]["substitution"]["twitter"] if domain.find('twitter.com') >=0 and twitter_subst != []: @@ -441,11 +439,6 @@ def main(argv): # Create global struct containing configuration global TOML - # We build the configuration by layering for each parameter: - # 1. A default value - # 2. The values read from the config file - # 3. The value provided on the command line - # Default options substitution = { 'twitter': [], @@ -465,9 +458,6 @@ def main(argv): 'substitution': substitution, } - # Default toml - TOML = {'config': {}, 'options': options} - # Parse command line args = vars(parser.parse_args()) @@ -484,6 +474,10 @@ def main(argv): except tomli.TOMLDecodeError: print('Malformed config file') exit(-1) + else: + # Default toml + TOML = {'config': {}, 'options': options} + # Override config parameters with command-line values if provided if args['t'] is not None: