def outputSubs(obj, text): subsname = '{0}OutputSubs'.format(obj.typeName) subs = obj.config.every(subsname, []) for sub in subs: for pattern, repl in sub: text = rxsub(pattern, repl, text) return text
def pathLines(value): """ Splits path string into lines, discarding comments. @param value unparsed path @return yields non-empty string value for each valid line """ value = rxsub(',?\s+and\s+', ', ', value) for line in value.split('\n'): if rxmatch(Rx.fullBcv, line): yield rxsplit(Rx.comment, line.strip())[0]