Add generator wrapper to fetch RedFams by status and ending
Related Task: [https://fs.golderweb.de/index.php?do=details&task_id=26 FS#26]
This commit is contained in:
@@ -467,6 +467,19 @@ class RedFamWorker( RedFam ):
|
|||||||
print(fam)
|
print(fam)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def gen_by_status_and_ending( cls, status, ending ):
|
||||||
|
"""
|
||||||
|
Yield red_fams stored in db by given status which have an ending after
|
||||||
|
given one
|
||||||
|
"""
|
||||||
|
mysql = MysqlRedFam()
|
||||||
|
for fam in mysql.get_by_status_and_ending( status, ending ):
|
||||||
|
try:
|
||||||
|
yield cls( fam )
|
||||||
|
except RedFamHashError:
|
||||||
|
print(fam)
|
||||||
|
raise
|
||||||
|
|
||||||
class RedFamError( Exception ):
|
class RedFamError( Exception ):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user