Skip to content

Commit

Permalink
fixed assertion error on wmlstr02
Browse files Browse the repository at this point in the history
  • Loading branch information
AncientLich committed May 25, 2016
1 parent bd78612 commit a262ff7
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions utils/pywmlx/state/wml_states.py
Expand Up @@ -135,21 +135,37 @@ def __init__(self):
self.iffail = 'wml_tag'

def run(self, xline, lineno, match):
# if will ever happen 'wmlstr02 assertion error' than you could
# turn 'mydebug' to 'True' to inspect what exactly happened.
# However this should be never necessary
mydebug = False
_nextstate = 'wml_idle'
loc_translatable = True
loc_multiline = False
loc_string = None
if match.group(1):
# match group(1) exists, so it is a single line string
# (group(2) will not exist, than)
if match.group(1) is not None:
loc_multiline = False
loc_string = match.group(1)
xline = xline [ match.end(): ]
elif match.group(2):
# match.group(2) exists, so it is a multi-line string
# (group(1) will not exist, than)
elif match.group(2) is not None:
loc_multiline = True
loc_string = match.group(2)
_nextstate = 'wml_str20'
xline = None
else:
wmlerr('wmlxgettext python sources', 'wmlstr02 assertion error\n'
if mydebug:
err_message = ("wmlstr02 assertion error (DEBUGGING)\n" +
'g1: ' + str(match.group(1)) + '\n' +
'g2: ' + str(match.group(2)) )
finfo = pywmlx.nodemanip.fileref + ":" + str(lineno)
wmlerr(finfo, err_message)
else:
wmlerr('wmlxgettext python sources',
'wmlstr02 assertion error\n'
'please report a bug if you encounter this error message')
pywmlx.state.machine._pending_wmlstring = (
pywmlx.state.machine.PendingWmlString(
Expand Down

0 comments on commit a262ff7

Please sign in to comment.