Add workaround to detect ending datetime if there is no done notice
This commit is contained in:
16
red_fam.py
16
red_fam.py
@@ -65,7 +65,7 @@ class RED_FAM_PARSER( RED_FAM ):
|
||||
__sectionhead_pat = re.compile( r"^=+.*\[\[.+\]\].*\[\[.+\]\].*=+$" )
|
||||
|
||||
# Define timestamp re.pattern
|
||||
__timestamp_pat = re.compile( r"\d{2}:\d{2}, (\d{1,2}. (Jan|Feb|Mär|Apr|Mai|Jun|Jul|Aug|Sep|Okt|Nov|Dez).? \d{4}) \(CES?T\)" )
|
||||
__timestamp_pat = re.compile( r"(\d{2}:\d{2}, \d{1,2}. (Jan|Feb|Mär|Apr|Mai|Jun|Jul|Aug|Sep|Okt|Nov|Dez).? \d{4} \(CES?T\))" )
|
||||
|
||||
# Textpattern for recognisation of done-notices
|
||||
__done_notice = ":<small>Archivierung dieses Abschnittes wurde gewünscht von:"
|
||||
@@ -270,6 +270,20 @@ class RED_FAM_PARSER( RED_FAM ):
|
||||
if result:
|
||||
return result.group()
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def is_ending2( cls, line ):
|
||||
"""
|
||||
Returns the last timestamp found in line, otherwise None
|
||||
@param str line String to search in
|
||||
|
||||
@returns str Timestamp, otherwise None
|
||||
"""
|
||||
result = cls.__timestamp_pat.findall( line )
|
||||
if result:
|
||||
return result[-1][0]
|
||||
else:
|
||||
return None
|
||||
|
||||
class RED_FAM_WORKER( RED_FAM ):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user