From: Jon Turney <jon.turney@dronecode.org.uk>
To: newlib@sourceware.org
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH] doc: Various fixes to makedocbook for python3.8
Date: Sat, 22 Aug 2020 19:45:20 +0100 [thread overview]
Message-ID: <20200822184520.57006-1-jon.turney@dronecode.org.uk> (raw)
---
newlib/doc/makedocbook.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/newlib/doc/makedocbook.py b/newlib/doc/makedocbook.py
index 92d0f279d..3fab26f1a 100755
--- a/newlib/doc/makedocbook.py
+++ b/newlib/doc/makedocbook.py
@@ -199,6 +199,8 @@ def function(c, l):
namelist = map(lambda v: re.sub('^and ', '', v.strip(), 1), namelist)
# strip off << >> surrounding name
namelist = map(lambda v: v.strip().lstrip('<').rstrip('>'), namelist)
+ # instantiate list to make it subscriptable
+ namelist = list(namelist)
if verbose:
print(namelist, file=sys.stderr)
@@ -262,7 +264,7 @@ def index(c, l):
primary.text = l
# to validate, it seems we need to maintain refentry elements in a certain order
- refentry[:] = sorted(refentry, key = lambda x: x.tag)
+ refentry[:] = sorted(refentry, key = lambda x: x.tag if isinstance(x.tag, str) else '')
# adds another alternate refname
refnamediv = refentry.find('refnamediv')
@@ -807,7 +809,7 @@ def main(file):
perform(processed)
# output the XML tree
- s = lxml.etree.tostring(rootelement, pretty_print=True)
+ s = lxml.etree.tostring(rootelement, pretty_print=True, encoding='unicode')
if not s:
print('No output produced (perhaps the input has no makedoc markup?)', file=sys.stderr)
@@ -826,7 +828,7 @@ def main(file):
if __name__ == '__main__' :
options = OptionParser()
- options.add_option('-v', '--verbose', action='count', dest = 'verbose')
+ options.add_option('-v', '--verbose', action='count', dest = 'verbose', default = 0)
options.add_option('-c', '--cache', action='store_true', dest = 'cache', help="just ensure PLY cache is up to date")
(opts, args) = options.parse_args()
--
2.28.0
next reply other threads:[~2020-08-22 18:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-22 18:45 Jon Turney [this message]
2020-08-23 15:23 ` Ken Brown
2020-08-23 19:41 ` Jon Turney
2020-08-23 22:49 ` Brian Inglis
2020-08-24 10:02 ` Corinna Vinschen
2020-08-24 10:01 ` Corinna Vinschen
2020-08-25 19:45 ` Jon Turney
2020-08-26 7:50 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200822184520.57006-1-jon.turney@dronecode.org.uk \
--to=jon.turney@dronecode.org.uk \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).