summaryrefslogtreecommitdiffstats
path: root/Tools/unicode/makeunicodedata.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2002-09-11 20:36:02 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2002-09-11 20:36:02 (GMT)
commitaaab30e00cc3e8d90c71b8657c284feeb4ac1413 (patch)
treed055e0bd374770014d9afdff1b961418b1828584 /Tools/unicode/makeunicodedata.py
parent6a0477b099560a452e37fe77c3850bf232487c16 (diff)
downloadcpython-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.zip
cpython-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.tar.gz
cpython-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.tar.bz2
Apply diff2.txt from SF patch http://www.python.org/sf/572113
(with one small bugfix in bgen/bgen/scantools.py) This replaces string module functions with string methods for the stuff in the Tools directory. Several uses of string.letters etc. are still remaining.
Diffstat (limited to 'Tools/unicode/makeunicodedata.py')
-rw-r--r--Tools/unicode/makeunicodedata.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Tools/unicode/makeunicodedata.py b/Tools/unicode/makeunicodedata.py
index 0eeb335..a18e548 100644
--- a/Tools/unicode/makeunicodedata.py
+++ b/Tools/unicode/makeunicodedata.py
@@ -100,7 +100,7 @@ def makeunicodedata(unicode, trace):
record = unicode.table[char]
if record:
if record[5]:
- decomp = string.split(record[5])
+ decomp = record[5].split()
# prefix
if decomp[0][0] == "<":
prefix = decomp.pop(0)
@@ -362,7 +362,7 @@ def makeunicodename(unicode, trace):
# indicates the last character in an entire string)
ww = w[:-1] + chr(ord(w[-1])+128)
# reuse string tails, when possible
- o = string.find(lexicon, ww)
+ o = lexicon.find(ww)
if o < 0:
o = offset
lexicon = lexicon + ww
@@ -442,7 +442,7 @@ def makeunicodename(unicode, trace):
# load a unicode-data file from disk
-import string, sys
+import sys
class UnicodeData:
@@ -453,8 +453,8 @@ class UnicodeData:
s = file.readline()
if not s:
break
- s = string.split(string.strip(s), ";")
- char = string.atoi(s[0], 16)
+ s = s.strip().split(";")
+ char = int(s[0], 16)
table[char] = s
# expand first-last ranges (ignore surrogates and private use)
@@ -490,7 +490,7 @@ class UnicodeData:
def myhash(s, magic):
h = 0
- for c in map(ord, string.upper(s)):
+ for c in map(ord, s.upper()):
h = (h * magic) + c
ix = h & 0xff000000
if ix:
@@ -598,7 +598,7 @@ class Array:
s = " " + i
else:
s = s + i
- if string.strip(s):
+ if s.strip():
file.write(s + "\n")
file.write("};\n\n")