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
87a42cd6
Commit
87a42cd6
authored
Mar 11, 1999
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for <platform>, some cleanup of module section after
creating the <moduleinfo>.
parent
49c7bc41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
Doc/tools/sgmlconv/docfixer.py
Doc/tools/sgmlconv/docfixer.py
+20
-0
No files found.
Doc/tools/sgmlconv/docfixer.py
View file @
87a42cd6
...
...
@@ -397,6 +397,7 @@ def create_module_info(doc, section):
modauthor
.
appendChild
(
doc
.
createTextNode
(
modauthor
.
getAttribute
(
"name"
)))
modauthor
.
removeAttribute
(
"name"
)
platform
=
extract_first_element
(
section
,
"platform"
)
if
section
.
tagName
==
"section"
:
modinfo_pos
=
2
modinfo
=
doc
.
createElement
(
"moduleinfo"
)
...
...
@@ -454,9 +455,28 @@ def create_module_info(doc, section):
if
modauthor
:
modinfo
.
appendChild
(
doc
.
createTextNode
(
"
\
n
"
))
modinfo
.
appendChild
(
modauthor
)
if
platform
:
modinfo
.
appendChild
(
doc
.
createTextNode
(
"
\
n
"
))
modinfo
.
appendChild
(
platform
)
modinfo
.
appendChild
(
doc
.
createTextNode
(
"
\
n
"
))
section
.
insertBefore
(
modinfo
,
section
.
childNodes
[
modinfo_pos
])
section
.
insertBefore
(
doc
.
createTextNode
(
"
\
n
"
),
modinfo
)
#
# The rest of this removes extra newlines from where we cut out
# a lot of elements. A lot of code for minimal value, but keeps
# keeps the generated SGML from being too funny looking.
#
section
.
normalize
()
children
=
section
.
childNodes
for
i
in
range
(
len
(
children
)):
node
=
children
[
i
]
if
node
.
nodeType
==
xml
.
dom
.
core
.
ELEMENT
\
and
node
.
tagName
==
"moduleinfo"
:
nextnode
=
children
[
i
+
1
]
if
nextnode
.
nodeType
==
xml
.
dom
.
core
.
TEXT
:
data
=
nextnode
.
data
if
len
(
string
.
lstrip
(
data
))
<
(
len
(
data
)
-
4
):
nextnode
.
data
=
"
\
n
\
n
\
n
"
+
string
.
lstrip
(
data
)
def
cleanup_synopses
(
doc
):
...
...
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