Correct use of pywikibot page.title()

This commit is contained in:
2015-09-11 14:12:26 +02:00
parent f8dacb53e1
commit 5e39ea0b06
2 changed files with 9 additions and 9 deletions

View File

@@ -197,7 +197,7 @@ class RED_FAM_PARSER( RED_FAM ):
# Do not change stati set by worker script etc. # Do not change stati set by worker script etc.
if not self.__mysql.data['status'] > 2: if not self.__mysql.data['status'] > 2:
# No ending, discussion is running: # No ending, discussion is running:
# Sometimes archived discussions also have no detectable ending # Sometimes archived discussions also have no detectable ending
if not self._ending and not self._red_page_archive: if not self._ending and not self._red_page_archive:

View File

@@ -39,14 +39,14 @@ class RED_PAGE:
self.__mysql = MYSQL_RED_PAGE( self.page._pageid ) self.__mysql = MYSQL_RED_PAGE( self.page._pageid )
if not self.__mysql.data: if not self.__mysql.data:
self.__mysql.add_page( self.page.title, self.page._revid ) self.__mysql.add_page( self.page.title(), self.page._revid )
def is_page_changed( self ): def is_page_changed( self ):
""" """
Check wether the page was changed since last run Check wether the page was changed since last run
""" """
if( self.__mysql.data != { 'page_id': self.page._pageid, 'rev_id': self.page._revid, 'page_title': self.page.title, 'status': self.__mysql.data[ 'status' ] } ): if( self.__mysql.data != { 'page_id': self.page._pageid, 'rev_id': self.page._revid, 'page_title': self.page.title(), 'status': self.__mysql.data[ 'status' ] } ):
self.__changed = True self.__changed = True
else: else:
self.__changed = False self.__changed = False
@@ -86,7 +86,7 @@ class RED_PAGE:
# Before working with next red_fam create the object for the one before (if one) # Before working with next red_fam create the object for the one before (if one)
if( fam_heading and beginning ): if( fam_heading and beginning ):
try: try:
red_fam = RED_FAM_PARSER( fam_heading, self.page._pageid, self.is_archive, beginning, ending ) red_fam = RED_FAM_PARSER( fam_heading, self.page._pageid, self.is_archive(), beginning, ending )
except: except:
pass pass
@@ -112,10 +112,10 @@ class RED_PAGE:
else: else:
# For the last red_fam create the object # For the last red_fam create the object
if( fam_heading and beginning ): if( fam_heading and beginning ):
try: #~ try:
red_fam = RED_FAM_PARSER( fam_heading, self.page._pageid, self.is_archive, beginning, ending ) red_fam = RED_FAM_PARSER( fam_heading, self.page._pageid, self.is_archive(), beginning, ending )
except: #~ except:
pass #~ pass
def __update_db( self ): def __update_db( self ):
""" """
Updates the page meta data in mysql db Updates the page meta data in mysql db
@@ -128,4 +128,4 @@ class RED_PAGE:
else: else:
status = 0 status = 0
self.__mysql.update_page( self.page._revid, self.page.title, status ) self.__mysql.update_page( self.page._revid, self.page.title(), status )