diff options
author | Neil <nyamatongwe@gmail.com> | 2021-04-09 13:38:45 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-04-09 13:38:45 +1000 |
commit | 04cea3a50855b43eb3febcbc39eaf9b24ea73abc (patch) | |
tree | 5a61d3b880501518bee67dba08271be92f9bb71e /scripts/FileGenerator.py | |
parent | 422064843aa559237587a9a0b633b561d1dcd613 (diff) | |
download | scintilla-mirror-04cea3a50855b43eb3febcbc39eaf9b24ea73abc.tar.gz |
Add count argument to ReplaceREInFile so can modify mutiple occurrences.
Fixed downloads page.
Diffstat (limited to 'scripts/FileGenerator.py')
-rw-r--r-- | scripts/FileGenerator.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/FileGenerator.py b/scripts/FileGenerator.py index 9fb32f46a..eb13e0fd5 100644 --- a/scripts/FileGenerator.py +++ b/scripts/FileGenerator.py @@ -214,8 +214,8 @@ def FindSectionInList(lines, markers): raise Exception("Could not find end marker " + markers[2]) return slice(start, end) -def ReplaceREInFile(path, match, replace): +def ReplaceREInFile(path, match, replace, count=1): with codecs.open(path, "r", "utf-8") as f: contents = f.read() - contents = re.sub(match, replace, contents, 1) + contents = re.sub(match, replace, contents, count) UpdateFile(path, contents) |