Rewrite RedPage.parse using mwparserfromhell to make it simpler

This commit is contained in:
2016-03-03 17:37:46 +01:00
parent b81694c6d3
commit 7422307985
2 changed files with 51 additions and 87 deletions

View File

@@ -126,8 +126,8 @@ class RedFamParser( RedFam ):
__timestamp_format = jogobot.config['redundances']['timestamp_format']
# Define section heading re.pattern
__sectionhead_pat = re.compile( r"^(=+)(.*\[\[.+\]\].*\[\[.+\]\].*)\1" )
__sectionhead_pat = re.compile( r"^(.*\[\[.+\]\].*\[\[.+\]\].*)" )
# Define timestamp re.pattern
__timestamp_pat = re.compile( jogobot.config['redundances']
['timestamp_regex'] )
@@ -333,8 +333,8 @@ class RedFamParser( RedFam ):
@returns bool Returns True if it is a section heading
"""
if cls.__sectionhead_pat.search( line ):
if cls.__sectionhead_pat.search( str(line) ):
return True
else:
return False