aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-04-09 13:38:45 +1000
committerNeil <nyamatongwe@gmail.com>2021-04-09 13:38:45 +1000
commit04cea3a50855b43eb3febcbc39eaf9b24ea73abc (patch)
tree5a61d3b880501518bee67dba08271be92f9bb71e
parent422064843aa559237587a9a0b633b561d1dcd613 (diff)
downloadscintilla-mirror-04cea3a50855b43eb3febcbc39eaf9b24ea73abc.tar.gz
Add count argument to ReplaceREInFile so can modify mutiple occurrences.
Fixed downloads page.
-rw-r--r--doc/ScintillaDownload.html6
-rw-r--r--scripts/FileGenerator.py4
-rw-r--r--scripts/LexGen.py3
3 files changed, 7 insertions, 6 deletions
diff --git a/doc/ScintillaDownload.html b/doc/ScintillaDownload.html
index a425f5b05..1739d3dd2 100644
--- a/doc/ScintillaDownload.html
+++ b/doc/ScintillaDownload.html
@@ -28,7 +28,7 @@
<td>
<font size="4"> <a href="https://www.scintilla.org/scintilla501.zip">
Windows</a>&nbsp;&nbsp;
- <a href="https://www.scintilla.org/scintilla500.tgz">
+ <a href="https://www.scintilla.org/scintilla501.tgz">
GTK/Linux</a>&nbsp;&nbsp;
</font>
</td>
@@ -50,8 +50,8 @@
The source code package contains all of the source code for Scintilla but no binary
executable code and is available in
<ul>
- <li><a href="https://www.scintilla.org/scintilla500.zip">zip format</a> (1.2M) commonly used on Windows</li>
- <li><a href="https://www.scintilla.org/scintilla500.tgz">tgz format</a> (1.1M) commonly used on Linux and compatible operating systems</li>
+ <li><a href="https://www.scintilla.org/scintilla501.zip">zip format</a> (1.2M) commonly used on Windows</li>
+ <li><a href="https://www.scintilla.org/scintilla501.tgz">tgz format</a> (1.2M) commonly used on Linux and compatible operating systems</li>
</ul>
Instructions for building on both Windows and Linux are included in the readme file.
<h4>
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)
diff --git a/scripts/LexGen.py b/scripts/LexGen.py
index c638e9878..f40efce04 100644
--- a/scripts/LexGen.py
+++ b/scripts/LexGen.py
@@ -40,7 +40,8 @@ def UpdateVersionNumbers(sci, root):
" Release " + sci.versionDotted)
ReplaceREInFile(root / "doc/ScintillaDownload.html",
r"/www.scintilla.org/([a-zA-Z]+)\d\d\d",
- r"/www.scintilla.org/\g<1>" + sci.version)
+ r"/www.scintilla.org/\g<1>" + sci.version,
+ 0)
UpdateLineInFile(root / "doc/index.html",
' <font color="#FFCC99" size="3"> Release version',
' <font color="#FFCC99" size="3"> Release version ' +\