From 51d8bb9da99f7793023f30a78298e400487b78db Mon Sep 17 00:00:00 2001 From: Jonathan Golder Date: Sat, 24 Sep 2016 18:59:39 +0200 Subject: [PATCH] Read Edit Summary from config To be able to change the Edit-Summary without touching the source code --- charts.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/charts.py b/charts.py index bf22484..a3146fe 100644 --- a/charts.py +++ b/charts.py @@ -94,9 +94,15 @@ class ChartsBot( ): # Output Information jogobot.output( "Chartsbot invoked" ) - # Set the edit summary message + # Save pywikibot site object self.site = pywikibot.Site() - self.summary = "Bot: Aktualisiere Übersichtsseite Nummer-eins-Hits" + + # Define edit summary + self.summary = jogobot.config["charts"]["edit_summary"].strip() + + # Make sure summary starts with "Bot:" + if not self.summary[:len("Bot:")] == "Bot:": + self.summary = "Bot: " + self.summary.strip() # Set locale to 'de_DE.UTF-8' locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8')