aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/ScintillaData.py
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-03-18 15:24:46 +1100
committerNeil <nyamatongwe@gmail.com>2014-03-18 15:24:46 +1100
commitfd889fc10965f12936308ddd824c29c7912da705 (patch)
tree90816e939570c0ab307d3bd14b4632e9788733e7 /scripts/ScintillaData.py
parente40f59323e9b9c3e0f889392e287c2f0a0d020c3 (diff)
downloadscintilla-mirror-fd889fc10965f12936308ddd824c29c7912da705.tar.gz
Extact credits from hsitory page with code.
Normalize credit format. Make list same as one shown in about box.
Diffstat (limited to 'scripts/ScintillaData.py')
-rw-r--r--scripts/ScintillaData.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/ScintillaData.py b/scripts/ScintillaData.py
index 1c999a119..bb21c2256 100644
--- a/scripts/ScintillaData.py
+++ b/scripts/ScintillaData.py
@@ -115,6 +115,30 @@ def FindPropertyDocumentation(lexFile):
del documents[name]
return documents
+def FindCredits(historyFile):
+ credits = []
+ stage = 0
+ with open(historyFile) as f:
+ for l in f.readlines():
+ l = l.strip()
+ if stage == 0 and l == "<table>":
+ stage = 1
+ elif stage == 1 and l == "</table>":
+ stage = 2
+ if stage == 1 and l.startswith("<td>"):
+ credit = l[4:-5]
+ if "<a" in l:
+ title, a, rest = credit.partition("<a href=")
+ urlplus, bracket, end = rest.partition(">")
+ name = end.split("<")[0]
+ url = urlplus[1:-1]
+ credit = title.strip()
+ if credit:
+ credit += " "
+ credit += name + " " + url
+ credits.append(credit.decode("utf-8"))
+ return credits
+
def ciCompare(a,b):
return cmp(a.lower(), b.lower())
@@ -173,6 +197,8 @@ class ScintillaData:
self.lexerProperties = list(lexerProperties)
SortListInsensitive(self.lexerProperties)
+ self.credits = FindCredits(scintillaRoot + "doc/ScintillaHistory.html")
+
def printWrapped(text):
print(textwrap.fill(text, subsequent_indent=" "))
@@ -191,3 +217,6 @@ if __name__=="__main__":
print(" " + k)
print(textwrap.fill(sci.propertyDocuments[k], initial_indent=" ",
subsequent_indent=" "))
+ print("Credits:")
+ for c in sci.credits:
+ print(" " + c.encode("utf-8"))