Functions | |
def | rulesParser |
Variables | |
tuple | rulesRegexpCompileFunction = lambdax:( len(x)==2 and (x[0], re.compile(x[1])) or (x[0], re.compile(x[1]), x[2]) ) |
Applies the (provided) regular expression rules (=rule[1] for rule in parsing_rules) to each line and if it matches the line, puts the mached information to the dictionary as the specified keys (=rule[0]) which is later returned Rule[3] contains whether the field is required to be found. If so and it isn't found the exception would be raised. rules = [ ( (field_name_1_to_match, field_name_2), regular expression, /optionaly: is the field required? if so "req"/ ) ]
Definition at line 9 of file parsingRulesHelper.py.
References Association.map, and match().
Referenced by parserPerfsuiteMetadata.parserPerfsuiteMetadata._applyParsingRules(), and FileNamesHelper.read_ConfigurationFromSimulationCandles().