summaryrefslogtreecommitdiff
path: root/python/build
Commit message (Collapse)AuthorAgeFilesLines
* build-aux: Split extract-ofp-fields.Adrian Moreno2022-07-151-0/+421
| | | | | | | | | | | In order to be able to reuse the core extraction logic, split the command in two parts. The core extraction logic is moved to python/build while the command that writes the different files out of the extracted field info is kept in build-aux. Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* xml2nroff: Fix formatting of action headers in ovs-actions(7) manpage.Ben Pfaff2021-05-061-4/+3
| | | | | | | | | | | | | | | | The action headings were coming out all smashed together, like "Theoutputaction". This fixes them so that they appear correctly, like "The output action". The previous code stripped starting and ending spaces on a per-node basis, so that "The ", "<code>output</code>", and " action" each got stripped down to "The", "output", "action" after processing. This commit changes it so that stripping happens after concatenation, fixing the problem. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-By: Timothy Redaelli <tredaelli@redhat.com> Tested-By: Timothy Redaelli <tredaelli@redhat.com>
* python: Fixup python shebangs to python3.Greg Rose2020-08-261-2/+2
| | | | | | | | | | | | | | | | | | Builds on RHEL 8.2 systems are failing due to this issue. See [1] as to why this is necessary. I used the following command to identify files that need this fix: find . -type f -executable | /usr/lib/rpm/redhat/brp-mangle-shebangs I also updated the copyright notices as needed. 1. https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error Fixes: 1ca0323e7c29 ("Require Python 3 and remove support for Python 2.") Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* docs: handle multi line headers for nroffIhar Hrachyshka2020-02-131-1/+8
| | | | | | | | | | | Before the fix, headers split into multiple lines were producing bogus quote characters in nroff output and failed to indent headers properly. Specifically, it fixes a header and its indentation in ovn-architecture(7). Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* python: Fix invalid escape sequences.Ben Pfaff2019-01-111-2/+2
| | | | | | | | | | It appears that Python silently treats invalid escape sequences in strings as literals, e.g. "\." is the same as "\\.". Newer versions of checkpatch complain, and it does seem reasonable to me to fix these. Acked-by: Numan Siddique <nusiddiq@redhat.com> Tested-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* nroff: Fix fonts for h2, h3, h4.Ben Pfaff2019-01-101-5/+5
| | | | | | | | Without this change, the fonts are wrong if a title contains formatting like <code> or <var>. Acked-by: Mark Michelson <mmichels@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* nroff: Increase width for .IP used for ordered lists.Ben Pfaff2019-01-101-1/+1
| | | | | | | | | | | | | | | | | | | The ordered lists that a .25in width produced looked OK in PostScript or PDF output, but in text output every list item spanned two lines, like this: 1. First list item. 2. Second list item. With this change, they appear normally: 1. First list item. 2. Second list item. Acked-by: Mark Michelson <mmichels@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb: Improve documentation.Ben Pfaff2017-12-141-7/+8
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* tests: Convert soexpand build tool from Perl to Python.Ben Pfaff2017-11-261-0/+56
| | | | | | | | Perl is unfashionable and Python is more widely available and understood, so this commit converts one of the OVS uses of Perl into Python. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* Python3 compatibility: fix integer problemsJason Wessel2017-07-061-0/+2
| | | | | | | | | | | | In python3 maxint is not defined, but maxsize is defined in both python2 and python3. The put_text() will not automatically use a value which came in as float due to a pior math function and python3 will throw an exception. The simple answer is to convert it with int() and move on. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-fields: New manpage to document Open vSwitch and OpenFlow fields.Ben Pfaff2017-01-251-14/+50
| | | | | | | | | There is still plenty of opportunity for improvement, but this new ovs-fields(7) manpage is much more comprehensive than ovs-ofctl(8) could be. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* nroff: Improve formatting of ASCII diagrams.Ben Pfaff2017-01-251-19/+61
| | | | | | | | | | | | | | | | | | | | | | | | | This makes diagrams in ASCII output look about as good as one might reasonably expect, so that in ovn-architecture(7), for example, this: . 9 bits: reserved (0) . 15 bits: ingress port . 16 bits: egress port . 24 bits: datapath now gets formatted as: 9 15 16 24 +--------+------------+-----------+--------+ |reserved|ingress port|egress port|datapath| +--------+------------+-----------+--------+ 0 which isn't perfect but certainly more evocative than a bulleted list. This will be more useful in upcoming commits that start using diagrams more frequently. Signed-off-by: Ben Pfaff <blp@ovn.org>
* python: Fix nroff indentation for <dl> after <hN>.Joe Stringer2017-01-061-3/+11
| | | | | | | | | | | | | | | When XML is used for writing manpages, in the case that there is a header tag followed by <dl>, the nroff python utility indents the <dl> tag (and children) an extra level which is unnecessary and makes the formatting inconsistent between manpages written directly in nroff vs manpages written in XML and converted to nroff. Fix the indentation by removing the extraneous .RS / .RE tags added to generated nroff in this case. This fixes the formatting of ovn/utilities/ovn-nbctl.8 man page. Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Convert dict iterators.Russell Bryant2016-01-211-1/+1
| | | | | | | | | | | | | | | | In Python 2, dict.items(), dict.keys(), and dict.values() returned a list. dict.iteritems(), dict.iterkeys(), and dict.itervalues() returned an iterator. As of Python 3, dict.iteritems(), dict.itervalues(), and dict.iterkeys() are gone. items(), keys(), and values() now return an iterator. In the case where we want an iterator, we now use the six.iter*() helpers. If we want a list, we explicitly create a list from the iterator. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Restrict line length to 79 chars.Russell Bryant2016-01-051-5/+10
| | | | | | | | | Resolve pep8 error: E501 line too long (80 > 79 characters) Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Resolve pep8 blank line errors.Russell Bryant2016-01-051-0/+6
| | | | | | | | | | Resolve pep8 errors E302 and E303: E302 expected 2 blank lines, found 1 E303 too many blank lines (3) Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Fix invalid varable/function references.Russell Bryant2016-01-051-0/+7
| | | | | | | | | | | | | This code referred to "rows" where it meant to refer to "fetched_rows". The patch resolves flake8 error: F821 undefined name 'rows' python/build/nroff.py used a function fatal() that was not defined, which raised the same type of error. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* nroff: Add support for <b>...</b> and <i>...</i> inline markup.Ben Pfaff2015-09-291-2/+2
| | | | | Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* nroff: Support inline XML inside <pre> blocks.Ben Pfaff2015-09-291-12/+14
| | | | | | | | | | | | This is useful so that one can write, e.g. <p>The following shows how to add 1 to variable <var>x</var>:</p> <pre> <var>x</var> = <var>x</var> + 1; </pre> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* nroff: Allow comments in more contexts.Ben Pfaff2015-08-261-3/+8
| | | | | | Reported-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Russell Bryant <rbryant@redhat.com>
* nroff: Add support for 'diagram' XML element for protocol headers.Ben Pfaff2015-08-031-0/+97
| | | | | | | | | | This will be used in documentation for an upcoming change, to document how Geneve OVN options are encoded. The code in this change is from a series (not yet submitted) that makes much more extensive use of it for documenting protocol headers. Signed-off-by: Ben Pfaff <blp@nicira.com>
* xml2nroff: Allow comments in block XML.Ben Pfaff2015-07-121-0/+2
| | | | | Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* nroff: Fix style of names.Ben Pfaff2015-07-061-28/+28
| | | | | | | | | | | | | The recommended Google Python style is multi_word_names, not multiWordNames. There are lots of other places where the style could be improved. I started here because I was working in this code anyway and because this code is only used at build time and not installed, so that it can't break any third-party code. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* nroff: Fix the escape of '.'.Ben Pfaff2015-06-231-1/+1
| | | | | Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
* ovn-nbctl: Take default database target from OVN_NB_DB in environment.Ben Pfaff2015-06-161-1/+1
| | | | | | | | | | This makes life easier for testing at the point you start to separate your environment into multiple machines. Also work on the manpage a little. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
* ovsdb-doc: Factor out nroff formatting into a separate Python module.Ben Pfaff2015-02-192-0/+185
This will make it cleaner to add another build-time program that generates nroff from XML. Signed-off-by: Ben Pfaff <blp@nicira.com>