Make markpages using new DB/Class structure

Update markpages and RedFamWorker-Code to use the new sqlalchemy based
DB ORM Interface
This commit is contained in:
2017-03-08 00:01:36 +01:00
parent 43e31c108a
commit 844fee52ae
2 changed files with 6 additions and 30 deletions

View File

@@ -78,6 +78,7 @@ class RedFam( MysqlRedFam ):
", red_page_id=" + repr( self.redpageid ) + \
", status=" + repr( self.status ) + \
", fam_hash=" + repr( self.famhash ) + \
", articlesStatus=" + repr( self.articlesStatus ) + \
" )"
return __repr
@@ -456,38 +457,10 @@ class RedFamWorker( RedFam ):
Handles working with redundance families stored in database
where discussion is finished
"""
def __init__( self, mysql_data ):
def __init__( self ):
#~ articlesList = []
#~ for key in sorted( mysql_data.keys() ):
#~ if 'article' in key and 'status' not in key and mysql_data[ key ]:
#~ articlesList.append( mysql_data[ key ] )
#~ # Preset article status list with empty sets for existing articles
#~ self._article_status = [set() for x in range(0, len(articlesList))]
#~ super().__init__( articlesList, mysql_data[ 'beginning' ],
#~ mysql_data[ 'ending' ], mysql_data[ 'redpageid' ],
#~ mysql_data[ 'status' ], mysql_data[ 'famhash' ],
#~ mysql_data[ 'heading' ] )
super().__init__()
# #~ self._mysql.data = mysql_data
#~ # Set up article status
#~ index = 0
#~ for article in self.articlesList:
#~ raw_status = mysql_data[ "article" + str(index) + "_status" ]
#~ if not raw_status:
#~ raw_status = str()
#~ self._article_parse_status( raw_status, index )
#~ index += 1
# Get related RedPage-Information
self.redpageid = mysql_data[ 'pageid' ]
self.redpagetitle = mysql_data[ 'pagetitle' ]
# Make sure locale is set to 'de_DE.UTF-8' to prevent problems
# with wrong month abreviations in strptime
locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8')