aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2013-04-09 13:52:53 +1000
committernyamatongwe <unknown>2013-04-09 13:52:53 +1000
commit3c0ce7c69b974a8535ac0f24cb1d2892c5e773d6 (patch)
tree868aba59514f13a39989ff268f2b28e8fccdc67f
parentdf2d4c896cc116ebce3f40718cfabc75eb804e38 (diff)
downloadscintilla-mirror-3c0ce7c69b974a8535ac0f24cb1d2892c5e773d6.tar.gz
Automate updating download links in script.
-rwxr-xr-xsrc/LexGen.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/LexGen.py b/src/LexGen.py
index d03c4a24a..233aeeb33 100755
--- a/src/LexGen.py
+++ b/src/LexGen.py
@@ -261,6 +261,23 @@ def UpdateLineInFile(path, linePrefix, lineReplace):
contents = NATIVE.join(lines) + NATIVE
UpdateFile(path, contents)
+host = "prdownloads.sourceforge.net/"
+def UpdateDownloadLinks(path, version):
+ lines = []
+ with open(path, "r") as f:
+ for l in f.readlines():
+ l = l.rstrip()
+ if host in l:
+ start, prd, rest = l.partition(host)
+ pth, dot, ending = rest.partition(".")
+ pthNew = pth[:-3] + version.rstrip()
+ lineWithNewVersion = start + prd +pthNew + dot + ending
+ lines.append(lineWithNewVersion)
+ else:
+ lines.append(l)
+ contents = NATIVE.join(lines) + NATIVE
+ UpdateFile(path, contents)
+
def UpdateVersionNumbers(root):
with open(root + "scintilla/version.txt") as f:
version = f.read()
@@ -279,6 +296,7 @@ def UpdateVersionNumbers(root):
"VERSION = " + versionDotted)
UpdateLineInFile(root + "scintilla/doc/ScintillaDownload.html", " Release",
" Release " + versionDotted)
+ UpdateDownloadLinks(root + "scintilla/doc/ScintillaDownload.html", version)
UpdateLineInFile(root + "scintilla/doc/index.html",
' <font color="#FFCC99" size="3"> Release version',
' <font color="#FFCC99" size="3"> Release version ' + versionDotted + '<br />')
@@ -290,6 +308,7 @@ def UpdateVersionNumbers(root):
"#define VERSION_WORDS " + versionCommad)
UpdateLineInFile(root + "scite/doc/SciTEDownload.html", " Release",
" Release " + versionDotted)
+ UpdateDownloadLinks(root + "scite/doc/SciTEDownload.html", version)
UpdateLineInFile(root + "scite/doc/SciTE.html",
' <font color="#FFCC99" size="3"> Release version',
' <font color="#FFCC99" size="3"> Release version ' + versionDotted + '<br />')