[Python-checkins] CVS: python/dist/src/Doc/tools anno-api.py,1.3,1.4

Fred L. Drake python-dev@python.org
Fri, 22 Sep 2000 10:55:35 -0700


Update of /cvsroot/python/python/dist/src/Doc/tools
In directory slayer.i.sourceforge.net:/tmp/cvs-serv7012

Modified Files:
	anno-api.py 
Log Message:

Fix the way we found relevant cfuncdesc lines; PREFIX was not a regular
expression!


Index: anno-api.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/anno-api.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** anno-api.py	2000/09/12 20:47:29	1.3
--- anno-api.py	2000/09/22 17:55:32	1.4
***************
*** 5,9 ****
  import getopt
  import os
- import string
  import sys
  
--- 5,8 ----
***************
*** 11,15 ****
  
  
! PREFIX = r"\begin{cfuncdesc}{Py(Var|)Object*}{"
  
  
--- 10,15 ----
  
  
! PREFIX_1 = r"\begin{cfuncdesc}{PyObject*}{"
! PREFIX_2 = r"\begin{cfuncdesc}{PyVarObject*}{"
  
  
***************
*** 31,36 ****
      if not args:
          args = ["-"]
-     prefix = PREFIX
-     prefix_len = len(prefix)
      for infile in args:
          if infile == "-":
--- 31,34 ----
***************
*** 42,47 ****
              if not line:
                  break
!             if line[:prefix_len] == prefix:
!                 s = string.split(line[prefix_len:], '}', 1)[0]
                  try:
                      info = rcdict[s]
--- 40,50 ----
              if not line:
                  break
!             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]
***************
*** 57,61 ****
                          line = (r"\begin{cfuncdesc}[%s]{%s}{"
                                  % (rc, info.result_type)) \
!                                 + line[prefix_len:]
              output.write(line)
          if infile != "-":
--- 60,64 ----
                          line = (r"\begin{cfuncdesc}[%s]{%s}{"
                                  % (rc, info.result_type)) \
!                                 + line[len(prefix):]
              output.write(line)
          if infile != "-":