summaryrefslogtreecommitdiffstats
path: root/bin/scons-proc.py
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2020-06-19 22:45:37 (GMT)
committerDirk Baechle <dl9obn@darc.de>2020-06-20 11:32:31 (GMT)
commit869005cb094d9b643da9d326471559f9a13981c1 (patch)
tree6bbb23f39a8c0cb87772fec413e6806659729b21 /bin/scons-proc.py
parent84c69dfe2d56f87d6cfdaf9c8b7e5e3a9b3d2619 (diff)
downloadSCons-869005cb094d9b643da9d326471559f9a13981c1.zip
SCons-869005cb094d9b643da9d326471559f9a13981c1.tar.gz
SCons-869005cb094d9b643da9d326471559f9a13981c1.tar.bz2
Fixed Sets/Uses links in generated doc files.
Diffstat (limited to 'bin/scons-proc.py')
-rw-r--r--bin/scons-proc.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/bin/scons-proc.py b/bin/scons-proc.py
index e1a2d19..fb9e6df 100644
--- a/bin/scons-proc.py
+++ b/bin/scons-proc.py
@@ -9,7 +9,6 @@
# DocBook-formatted generated XML files containing the summary text
# and/or .mod files containing the ENTITY definitions for each item.
#
-# TODO DB Check file encoding for unicode/utf-8
import getopt
import os
import sys
@@ -67,7 +66,6 @@ def parse_docs(args, include_entities=True):
raise
else:
# mode we read (text/bytes) has to match handling in SConsDoc
- # TODO DB Check file encoding for unicode/utf-8
with open(f, 'r') as fp:
content = fp.read()
if content:
@@ -78,14 +76,12 @@ def parse_docs(args, include_entities=True):
raise
return h
-# TODO DB Check file encoding for unicode/utf-8
Warning = """\
<!--
THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
-->
"""
-# TODO DB Check file encoding for unicode/utf-8
Regular_Entities_Header = """\
<!--
@@ -111,7 +107,6 @@ class SCons_XML:
def fopen(self, name, mode='w'):
if name == '-':
return sys.stdout
-# TODO DB Check file encoding for unicode/utf-8
return open(name, mode)
def write(self, files):
@@ -146,16 +141,20 @@ class SCons_XML:
if v.sets:
added = True
vp = stf.newNode("para")
- s = ['&cv-link-%s;' % x for x in v.sets]
- stf.setText(vp, 'Sets: ' + ', '.join(s) + '.')
+ stf.setText(vp, 'Sets: ')
+ for x in v.sets[:-1]:
+ stf.appendCvLink(vp, x, ', ')
+ stf.appendCvLink(vp, v.sets[-1], '.')
stf.appendNode(vl, vp)
if v.uses:
added = True
vp = stf.newNode("para")
- u = ['&cv-link-%s;' % x for x in v.uses]
- stf.setText(vp, 'Uses: ' + ', '.join(u) + '.')
- stf.appendNode(vl, vp)
+ stf.setText(vp, 'Uses: ')
+ for x in v.uses[:-1]:
+ stf.appendCvLink(vp, x, ', ')
+ stf.appendCvLink(vp, v.uses[-1], '.')
+ stf.appendNode(vl, vp)
# Still nothing added to this list item?
if not added:
@@ -167,7 +166,6 @@ class SCons_XML:
stf.appendNode(root, ve)
# Write file
-# TODO DB Check file encoding for unicode/utf-8
f = self.fopen(filename)
stf.writeGenTree(root, f)
f.close()
@@ -188,7 +186,6 @@ class SCons_XML:
f.write('\n')
f.write(Regular_Entities_Header % description)
f.write('\n')
-# TODO DB Check file encoding for unicode/utf-8
for v in self.values:
f.write('<!ENTITY %s%s "<%s xmlns=\'%s\'>%s</%s>">\n' %
(v.prefix, v.idfunc(),