On Mon, Jun 15, 2015 at 01:22:59PM -0700, Alex Wang wrote:
> On Sun, Jun 14, 2015 at 12:19 PM, Ben Pfaff <b...@nicira.com> wrote:
> 
> > This allows XML-generated manpages in the source tree to include correct
> > directory names for the local configuration, instead of just the plain
> > nroff ones.
> >
> > Signed-off-by: Ben Pfaff <b...@nicira.com>
> > ---
> >  build-aux/xml2nroff | 30 +++++++++++++++++++++++++-----
> >  ovn/automake.mk     | 17 +++++++++++++++--
> >  2 files changed, 40 insertions(+), 7 deletions(-)
> >
> > diff --git a/build-aux/xml2nroff b/build-aux/xml2nroff
> > index 8dc9d4f..2dbbe50 100755
> > --- a/build-aux/xml2nroff
> > +++ b/build-aux/xml2nroff
> > @@ -28,17 +28,26 @@ def usage():
> >      print """\
> >  %(argv0)s: XML to nroff converter
> >  Converts the XML format supplied as input into an nroff-formatted manpage.
> > -usage: %(argv0)s [OPTIONS] INPUT.XML
> > +usage: %(argv0)s [OPTIONS] INPUT.XML [VAR=VALUE]...
> >  where INPUT.XML is a manpage in an OVS-specific XML format.
> >
> > +Each VAR, when enclosed by "@"s in the input, is replaced by its
> > +corresponding VALUE, with characters &<>"' in VALUE escaped.
> > +
> >  The following options are also available:
> >    --version=VERSION           use VERSION to display on document footer
> >    -h, --help                  display this help message\
> >  """ % {'argv0': argv0}
> >      sys.exit(0)
> >
> > -def manpage_to_nroff(xml_file, version=None):
> > -    doc = xml.dom.minidom.parse(xml_file).documentElement
> > +def manpage_to_nroff(xml_file, subst, version=None):
> > +    f = open(xml_file)
> > +    input = []
> > +    for line in f:
> > +        for k, v in subst.iteritems():
> > +            line = line.replace(k, v)
> > +        input += [line]
> > +    doc = xml.dom.minidom.parseString(''.join(input)).documentElement
> >      d = date.fromtimestamp(os.stat(xml_file).st_mtime)
> >
> >      if version == None:
> > @@ -102,13 +111,24 @@ if __name__ == "__main__":
> >          else:
> >              sys.exit(0)
> >
> > -    if len(args) != 1:
> > +    if len(args) < 1:
> >          sys.stderr.write("%s: exactly 1 non-option arguments required "
> >                           "(use --help for help)\n" % argv0)
> >          sys.exit(1)
> >
> > +    input = args[0]
> >
> 
> 
> 
> The 'input' is unused,
> 
> Acked-by: Alex Wang <al...@nicira.com>

Thanks!  I will remove that statement.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to