Add param to RED_PAGE for predefining page status archived when using cat of archives

This commit is contained in:
2015-09-11 14:10:33 +02:00
parent ebf7a8fe0b
commit f8dacb53e1

View File

@@ -7,7 +7,7 @@ from red_fam import RED_FAM_PARSER
class RED_PAGE: class RED_PAGE:
"""Class for handling redundance discussion pages and archives""" """Class for handling redundance discussion pages and archives"""
def __init__( self, page ): def __init__( self, page, archive=False ):
""" """
Generate a new RED_PAGE object based on the given pywikibot page object Generate a new RED_PAGE object based on the given pywikibot page object
@@ -16,6 +16,7 @@ class RED_PAGE:
# Safe the pywikibot page object # Safe the pywikibot page object
self.page = page self.page = page
self._archive = archive
self.__handle_db( ) self.__handle_db( )
@@ -54,7 +55,7 @@ class RED_PAGE:
""" """
Detects wether current page is an archive of discussions Detects wether current page is an archive of discussions
""" """
if u"/Archiv" in self.page.title: if self._archive or ( u"/Archiv" in self.page.title() ):
return True return True
else: else:
return False return False