I get following error:
Python Exception <error>: unbalanced parenthesis
Traceback (most recent call last):
File "<string>", line 16, in input
File "C:\\Program Files\\FME\\fmepython27\\lib\\re.py", line 142, in search
return _compile(pattern, flags).search(string)
File "C:\\Program Files\\FME\\fmepython27\\lib\\re.py", line 245, in _compile
raise error, v # invalid expression
error: unbalanced parenthesis
Error encountered while calling method `input'
PythonFactory failed to process feature
PythonFactory failed to process feature
A fatal error has occurred. Check the logfile above for details
A fatal error has occurred. Check the logfile above for details
for using following script;
import fmeobjects, re class FeatureProcessor(object): def __init__(self): pass def input(self, feature): SOURCE = feature.getAttribute('SOURCE') MATCH = feature.getAttribute('_list{}.MATCH') if not SOURCE or not MATCH: return feature.removeAttrsWithPrefix('_list') for MATCH in MATCH: if re.search(MATCH, SOURCE, re.IGNORECASE): newFeature = feature.cloneAttributes() newFeature.setAttribute('MATCH', MATCH) self.pyoutput(newFeature) def close(self): pass
Any suggestions?
Thanks in advance