The Gaudi Framework
master (37c0b60a)
|
Public Member Functions | |
def | __init__ (self, Union[str, re.Pattern] pattern, Union[str, Callable[[str, Fields], str]] replace) |
str | __call__ (self, str line, Fields fields) |
Public Attributes | |
pattern | |
replace | |
Helper to replace lines with patterns or applying functions. >>> r = ReplacementRule(r"^version: ", "version: {cmake_version}") >>> f = Fields("v1r1", datetime.date(2023, 9, 25)) >>> r("nothing to change\\n", f) 'nothing to change\\n' >>> r("version: 1.0\\n", f) 'version: 1.1\\n'
Definition at line 72 of file update_version.py.
def update_version.ReplacementRule.__init__ | ( | self, | |
Union[str, re.Pattern] | pattern, | ||
Union[str, Callable[[str, Fields], str]] | replace | ||
) |
Definition at line 84 of file update_version.py.
str update_version.ReplacementRule.__call__ | ( | self, | |
str | line, | ||
Fields | fields | ||
) |
Definition at line 96 of file update_version.py.
update_version.ReplacementRule.pattern |
Definition at line 85 of file update_version.py.
update_version.ReplacementRule.replace |
Definition at line 88 of file update_version.py.