Browse Source

Log year change related actions

Improve logging related to atomatically changed years in list title

[https://fs.golderweb.de/index.php?do=details&task_id=67|FS#67]
develop
Jonathan Golder 5 years ago
parent
commit
f3635b2458
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      summarypage.py

+ 9
- 0
summarypage.py View File

@ -30,6 +30,8 @@ from datetime import datetime, timedelta
# import pywikibot
import mwparserfromhell as mwparser
import jogobot
from countrylist import CountryList, CountryListError
@ -145,6 +147,9 @@ class SummaryPageEntry():
# If list is from last year, replace year
if (current_year - 1) in self.countrylist_wikilink.title:
jogobot.output( "Trying to use new years list for [[{page}]]"
.format( page=self.countrylist_wikilink.title ) )
self.countrylist_wikilink.title.replace( (current_year - 1),
current_year )
@ -159,6 +164,10 @@ class SummaryPageEntry():
# If list is from last year, replace year
if (current_year ) in self.countrylist_wikilink.title:
jogobot.output( "New years list for [[{page}]] does not " +
"exist, fall back to old list!".format(
page=self.countrylist_wikilink.title ) )
self.countrylist_wikilink.title.replace( current_year,
(current_year - 1) )


Loading…
Cancel
Save