diff options
author | Neil <nyamatongwe@gmail.com> | 2014-03-18 15:24:46 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-03-18 15:24:46 +1100 |
commit | 4c32fec69fef280deafbc7dd656ab0561d366897 (patch) | |
tree | 41d8a78140af793674c65e16006d065d5e784259 /scripts/ScintillaData.py | |
parent | b636a2a38e6c9bbda212ac1808510cae844c4161 (diff) | |
download | scintilla-mirror-4c32fec69fef280deafbc7dd656ab0561d366897.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.py | 29 |
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")) |