Correct use of pywikibot page.title()
This commit is contained in:
@@ -197,7 +197,7 @@ class RED_FAM_PARSER( RED_FAM ):
|
||||
|
||||
# Do not change stati set by worker script etc.
|
||||
if not self.__mysql.data['status'] > 2:
|
||||
|
||||
|
||||
# No ending, discussion is running:
|
||||
# Sometimes archived discussions also have no detectable ending
|
||||
if not self._ending and not self._red_page_archive:
|
||||
|
||||
16
red_page.py
16
red_page.py
@@ -39,14 +39,14 @@ class RED_PAGE:
|
||||
self.__mysql = MYSQL_RED_PAGE( self.page._pageid )
|
||||
|
||||
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 ):
|
||||
"""
|
||||
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
|
||||
else:
|
||||
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)
|
||||
if( fam_heading and beginning ):
|
||||
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:
|
||||
pass
|
||||
|
||||
@@ -112,10 +112,10 @@ class RED_PAGE:
|
||||
else:
|
||||
# For the last red_fam create the object
|
||||
if( fam_heading and beginning ):
|
||||
try:
|
||||
red_fam = RED_FAM_PARSER( fam_heading, self.page._pageid, self.is_archive, beginning, ending )
|
||||
except:
|
||||
pass
|
||||
#~ try:
|
||||
red_fam = RED_FAM_PARSER( fam_heading, self.page._pageid, self.is_archive(), beginning, ending )
|
||||
#~ except:
|
||||
#~ pass
|
||||
def __update_db( self ):
|
||||
"""
|
||||
Updates the page meta data in mysql db
|
||||
@@ -128,4 +128,4 @@ class RED_PAGE:
|
||||
else:
|
||||
status = 0
|
||||
|
||||
self.__mysql.update_page( self.page._revid, self.page.title, status )
|
||||
self.__mysql.update_page( self.page._revid, self.page.title(), status )
|
||||
|
||||
Reference in New Issue
Block a user