Format fixes

Set locale to de_DE.utf-8 for whole Task

Make sure Template is added in own source line
This commit is contained in:
2017-03-10 23:28:24 +01:00
parent 65de6decb2
commit 868894a38b
2 changed files with 8 additions and 0 deletions

View File

@@ -224,6 +224,9 @@ class MarkPagesBot( CurrentPageBot ): # sets 'current_page' on each treat()
else: else:
self.current_wikicode.insert( 0, self.disc_notice ) self.current_wikicode.insert( 0, self.disc_notice )
# To have it in its own line we need to add a linbreak after it
self.current_wikicode.insert_after(self.disc_notice, "\n" )
# Notice was added # Notice was added
return True return True

5
red.py
View File

@@ -26,6 +26,7 @@ Wrapper script to invoke all redundances bot tasks
""" """
import os import os
import locale
import pywikibot import pywikibot
@@ -92,6 +93,10 @@ def main(*args):
@type args: list of unicode @type args: list of unicode
""" """
# Make sure locale is set to 'de_DE.UTF-8' to prevent problems
# with wrong month abreviations in strptime
locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8')
# Process global arguments to determine desired site # Process global arguments to determine desired site
local_args = pywikibot.handle_args(args) local_args = pywikibot.handle_args(args)