diff options
author | nyamatongwe <unknown> | 2009-04-01 01:44:14 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2009-04-01 01:44:14 +0000 |
commit | 6f4e00a1c5ef532b0c4c875d808037c9978cad19 (patch) | |
tree | f5969081c69fdf05a7efec45b5bac376bad9235c /include/HFacer.py | |
parent | 4963aae22bedfb1f04703cb0880156f4d0366e74 (diff) | |
download | scintilla-mirror-6f4e00a1c5ef532b0c4c875d808037c9978cad19.tar.gz |
Compatible with Python versions 2.3 to 3.0.
Diffstat (limited to 'include/HFacer.py')
-rw-r--r-- | include/HFacer.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/HFacer.py b/include/HFacer.py index 1b4d62746..62a827326 100644 --- a/include/HFacer.py +++ b/include/HFacer.py @@ -4,13 +4,12 @@ # comment and a /* --Autogenerated*/ comment which is generated by the printHFile and printLexHFile # functions. After the temporary file is created, it is copied back to the original file name. -import string import sys import os import Face def Contains(s,sub): - return string.find(s, sub) != -1 + return s.find(sub) != -1 def printLexHFile(f,out): for name in f.order: @@ -24,10 +23,10 @@ def printHFile(f,out): v = f.features[name] if v["Category"] != "Deprecated": if v["FeatureType"] in ["fun", "get", "set"]: - featureDefineName = "SCI_" + string.upper(name) + featureDefineName = "SCI_" + name.upper() out.write("#define " + featureDefineName + " " + v["Value"] + "\n") elif v["FeatureType"] in ["evt"]: - featureDefineName = "SCN_" + string.upper(name) + featureDefineName = "SCN_" + name.upper() out.write("#define " + featureDefineName + " " + v["Value"] + "\n") elif v["FeatureType"] in ["val"]: if not (Contains(name, "SCE_") or Contains(name, "SCLEX_")): @@ -46,7 +45,7 @@ def CopyWithInsertion(input, output, genfn, definition): output.write(line) def contents(filename): - f = file(filename) + f = open(filename) t = f.read() f.close() return t @@ -71,6 +70,6 @@ try: f.ReadFromFile("Scintilla.iface") Regenerate("Scintilla.h", printHFile, f) Regenerate("SciLexer.h", printLexHFile, f) - print "Maximum ID is", max([x for x in f.values if int(x) < 3000]) + print("Maximum ID is %s" % max([x for x in f.values if int(x) < 3000])) except: raise |