diff options
author | Fred Drake <fdrake@acm.org> | 2000-09-22 17:55:32 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-09-22 17:55:32 (GMT) |
commit | 3764b6b67ec28e594d03bb95efb9b9ad029f018c (patch) | |
tree | 08e7ff17c4de534bf38e3e67077cdc8af8ccd06f /Doc | |
parent | 7f58e2ec76e778b88fa48fdb5bde4d18e4e64c8e (diff) | |
download | cpython-3764b6b67ec28e594d03bb95efb9b9ad029f018c.zip cpython-3764b6b67ec28e594d03bb95efb9b9ad029f018c.tar.gz cpython-3764b6b67ec28e594d03bb95efb9b9ad029f018c.tar.bz2 |
Fix the way we found relevant cfuncdesc lines; PREFIX was not a regular
expression!
Diffstat (limited to 'Doc')
-rwxr-xr-x | Doc/tools/anno-api.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Doc/tools/anno-api.py b/Doc/tools/anno-api.py index 420f271..b4b7f79 100755 --- a/Doc/tools/anno-api.py +++ b/Doc/tools/anno-api.py @@ -4,13 +4,13 @@ __version__ = '$Revision$' import getopt import os -import string import sys import refcounts -PREFIX = r"\begin{cfuncdesc}{Py(Var|)Object*}{" +PREFIX_1 = r"\begin{cfuncdesc}{PyObject*}{" +PREFIX_2 = r"\begin{cfuncdesc}{PyVarObject*}{" def main(): @@ -30,8 +30,6 @@ def main(): output = open(outfile, "w") if not args: args = ["-"] - prefix = PREFIX - prefix_len = len(prefix) for infile in args: if infile == "-": input = sys.stdin @@ -41,8 +39,13 @@ def main(): line = input.readline() if not line: break - if line[:prefix_len] == prefix: - s = string.split(line[prefix_len:], '}', 1)[0] + prefix = None + if line.startswith(PREFIX_1): + prefix = PREFIX_1 + elif line.startswith(PREFIX_2): + prefix = PREFIX_2 + if prefix: + s = line[len(prefix):].split('}', 1)[0] try: info = rcdict[s] except KeyError: @@ -56,7 +59,7 @@ def main(): rc = rc + " reference" line = (r"\begin{cfuncdesc}[%s]{%s}{" % (rc, info.result_type)) \ - + line[prefix_len:] + + line[len(prefix):] output.write(line) if infile != "-": input.close() |