Read Edit Summary from config

To be able to change the Edit-Summary without touching the source code
This commit is contained in:
2016-09-24 18:59:39 +02:00
parent f3635b2458
commit 51d8bb9da9

View File

@@ -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')