Definition at line 102 of file update_version.py.
◆ __init__()
def update_version.FileUpdater.__init__ |
( |
|
self, |
|
|
str |
filename, |
|
|
Iterable[Union[ReplacementRule, tuple[str, str]]]
|
rules |
|
) |
| |
Definition at line 103 of file update_version.py.
104 self, filename: str, rules: Iterable[Union[ReplacementRule, tuple[str, str]]]
106 self.filename = filename
108 r
if isinstance(r, ReplacementRule)
else ReplacementRule(*r)
for r
in rules
◆ __call__()
tuple[str, list[str], list[str]] update_version.FileUpdater.__call__ |
( |
|
self, |
|
|
Fields |
fields |
|
) |
| |
Definition at line 116 of file update_version.py.
116 def __call__(self, fields: Fields) -> tuple[str, list[str], list[str]]:
117 with open(self.filename)
as f:
119 return self.filename, old, [self._apply_rules(line, fields)
for line
in old]
◆ _apply_rules()
str update_version.FileUpdater._apply_rules |
( |
|
self, |
|
|
str |
line, |
|
|
Fields |
fields |
|
) |
| |
|
private |
Definition at line 111 of file update_version.py.
111 def _apply_rules(self, line: str, fields: Fields) -> str:
112 for rule
in self.rules:
113 line = rule(line, fields)
◆ filename
update_version.FileUpdater.filename |
◆ rules
update_version.FileUpdater.rules |
The documentation for this class was generated from the following file: