Add additional possibilities to detect wether a red_page is an archive or not

This commit is contained in:
2015-09-12 13:48:01 +02:00
parent e70655f679
commit f50f4b664f

View File

@@ -58,7 +58,7 @@ class RED_PAGE:
"""
Detects wether current page is an archive of discussions
"""
if self._archive or ( u"/Archiv" in self.page.title() ):
if self._archive or ( u"/Archiv" in self.page.title() ) or ( "{{Archiv}}" in self.page.text ) or ( "{{Archiv|" in self.page.text ):
return True
else:
return False
@@ -91,7 +91,6 @@ class RED_PAGE:
last_fam = i
# Save heading
fam_heading = line
pywikibot.output( fam_heading )
# Defined (re)initialisation of dates
beginning = None
@@ -124,8 +123,8 @@ class RED_PAGE:
j -= 1
ending = RED_FAM_PARSER.is_ending2( text_lines[ j ] )
red_fam = RED_FAM_PARSER( fam_heading, self.page._pageid, self.is_archive(), beginning, ending )
pywikibot.output( red_fam )
# Increment line counter
i += 1