summaryrefslogtreecommitdiffstats
path: root/Mac/scripts/mkestrres.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1998-04-21 15:27:45 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1998-04-21 15:27:45 (GMT)
commit955a2f532841d0d56694741b64eb5a25fb392f74 (patch)
tree62ffbc345ce134ca88086f36b93766b51f0bf7a8 /Mac/scripts/mkestrres.py
parentcf89f6fc7d7e4241552686a7547a53856833b5bf (diff)
downloadcpython-955a2f532841d0d56694741b64eb5a25fb392f74.zip
cpython-955a2f532841d0d56694741b64eb5a25fb392f74.tar.gz
cpython-955a2f532841d0d56694741b64eb5a25fb392f74.tar.bz2
If there's no comment for an error we use the symbolic name as the
error message. Not really fantastic, but "reqAborted" is better than "MacOS error -1105" at least.
Diffstat (limited to 'Mac/scripts/mkestrres.py')
-rw-r--r--Mac/scripts/mkestrres.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Mac/scripts/mkestrres.py b/Mac/scripts/mkestrres.py
index f9874f6..a1a6049 100644
--- a/Mac/scripts/mkestrres.py
+++ b/Mac/scripts/mkestrres.py
@@ -25,6 +25,12 @@ ERRORS_PROG="[ \t]*" \
"[, \t]*/\*[ \t]*" \
"\(.*\)" \
"[ \t]*\*/"
+
+ERRORS_PROG_2="[ \t]*" \
+ "\([A-Z0-9a-z_]+\)" \
+ "[ \t]*=[ \t]*" \
+ "\([-0-9]+\)" \
+ "[, \t]*"
def Pstring(str):
if len(str) > 255:
@@ -68,11 +74,20 @@ def parse_errno_h(fp, dict):
def parse_errors_h(fp, dict):
errno_prog = regex.compile(ERRORS_PROG)
+ errno_prog_2 = regex.compile(ERRORS_PROG_2)
for line in fp.readlines():
+ match = 0
if errno_prog.match(line) > 0:
number = string.atoi(errno_prog.group(2))
name = errno_prog.group(1)
desc = string.strip(errno_prog.group(3))
+ match=1
+ elif errno_prog_2.match(line) > 0:
+ number = string.atoi(errno_prog_2.group(2))
+ name = errno_prog_2.group(1)
+ desc = name
+ match=1
+ if match:
if number > 0: continue
if not dict.has_key(number):
@@ -81,6 +96,9 @@ def parse_errors_h(fp, dict):
print 'DUPLICATE', number
print '\t', dict[number]
print '\t', (desc, name)
+ if len(desc) > len(dict[number][0]):
+ print 'Pick second one'
+ dict[number] = desc, name
def main():
dict = {}