Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
31d209d6
Commit
31d209d6
authored
Sep 22, 2000
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the way we found relevant cfuncdesc lines; PREFIX was not a regular
expression!
parent
6b8faf6e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
Doc/tools/anno-api.py
Doc/tools/anno-api.py
+10
-7
No files found.
Doc/tools/anno-api.py
View file @
31d209d6
...
...
@@ -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()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment