From f241a9aef30a8814248005477d4bc50adfc7d099 Mon Sep 17 00:00:00 2001 From: HelloZeroNet Date: Wed, 16 Mar 2016 23:25:27 +0100 Subject: [PATCH] Fix donationmessage plugin --- .../DonationMessagePlugin.py | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/plugins/disabled-DonationMessage/DonationMessagePlugin.py b/plugins/disabled-DonationMessage/DonationMessagePlugin.py index 00be03f1..14f95b08 100644 --- a/plugins/disabled-DonationMessage/DonationMessagePlugin.py +++ b/plugins/disabled-DonationMessage/DonationMessagePlugin.py @@ -6,19 +6,17 @@ from Plugin import PluginManager @PluginManager.registerTo("UiRequest") class UiRequestPlugin(object): - # Inject a donation message to every page top right corner - def actionWrapper(self, path): - back = super(UiRequestPlugin, self).actionWrapper(path) - if not back or not hasattr(back, "endswith"): return back # Wrapper error or not string returned, injection not possible + # Inject a donation message to every page top right corner + def renderWrapper(self, *args, **kwargs): + body = super(UiRequestPlugin, self).renderWrapper(*args, **kwargs) # Get the wrapper frame output - back = re.sub("\s*\s*$", - """ - - Please donate to help to keep this ZeroProxy alive - - - """, back) + inject_html = """ + + Please donate to help to keep this ZeroProxy alive + + + """ - return back + return re.sub("\s*\s*$", inject_html, body)