From 5c29dfed8d0871466dd439cc611e9a85c78bd6c0 Mon Sep 17 00:00:00 2001 From: Carl Chenet Date: Mon, 26 Aug 2019 16:47:53 +0200 Subject: [PATCH] fix plugins --- feed2toot/main.py | 15 ++++++++------- feed2toot/plugins/__init__.py | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/feed2toot/main.py b/feed2toot/main.py index ff2041c..8e7b52a 100644 --- a/feed2toot/main.py +++ b/feed2toot/main.py @@ -39,6 +39,7 @@ from feed2toot.lock import LockFile from feed2toot.message import build_message from feed2toot.message import send_message_dry_run from feed2toot.message import send_message +from feed2toot.plugins import activate_plugins from feed2toot.removeduplicates import RemoveDuplicates from feed2toot.rss import populate_rss from feed2toot.sortentries import sort_entries @@ -116,13 +117,13 @@ class Main: entrytosend = fe.finalentry if entrytosend: finaltweet = build_message(entrytosend, tweetformat, rss) - if clioptions.dryrun: - send_message_dry_run(config, entrytosend, finaltweet) - else: - send_message(config, clioptions, options, entrytosend, finaltweet, cache, rss) - # plugins - if plugins and entrytosend: - activate_plugins(plugins) + if clioptions.dryrun: + send_message_dry_run(config, entrytosend, finaltweet) + else: + send_message(config, clioptions, options, entrytosend, finaltweet, cache, rss) + # plugins + if plugins and entrytosend: + activate_plugins(plugins, finaltweet) # do not forget to close cache (shelf object) cache.close() # release the lock file diff --git a/feed2toot/plugins/__init__.py b/feed2toot/plugins/__init__.py index bcccc6a..f6ac8a4 100644 --- a/feed2toot/plugins/__init__.py +++ b/feed2toot/plugins/__init__.py @@ -17,7 +17,7 @@ # standard libraires imports import importlib -def activate_plugins(entrytosend): +def activate_plugins(plugins, finaltweet): '''activate plugins''' for plugin in plugins: capitalizedplugin = plugin.title()