diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2009-12-20 23:09:32 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2009-12-20 23:09:32 -0500 |
commit | 93c0674b5f8c6d5b444cf17479dd94346db812f5 (patch) | |
tree | d0a831919b0e2b89e60946fb6c932377249d4182 | |
parent | 617c026ff70fd6d3ae61bd27d5447f851414fd2e (diff) |
Support --no-convert option to switch on/off conversion to docbook.
-rwxr-xr-x | ooo-help-parser.py | 9 | ||||
-rw-r--r-- | source/expatimpl.py | 3 |
2 files changed, 6 insertions, 6 deletions
diff --git a/ooo-help-parser.py b/ooo-help-parser.py index c96dee0..7fa8b6b 100755 --- a/ooo-help-parser.py +++ b/ooo-help-parser.py @@ -9,6 +9,8 @@ def main (): parser = optparse.OptionParser() parser.set_defaults(output=None) parser.add_option("-o", "--output", dest="output", help="write output to FILE", metavar="FILE") + parser.add_option("--no-convert", action="store_false", dest="convert", + help="Don't convert to docbook but simply output the parsed raw xhp structure", default=True) options, args = parser.parse_args() if len(args) == 0: parser.print_help() @@ -35,14 +37,15 @@ def main (): filesParsed = 0 for fpath in filepaths: -# globals.info("processing " + fpath) file = open(fpath, 'r') strm = file.read() file.close() p = expatimpl.Parser(strm) p.parse() - p.printSummary(fd) - p.prettyPrint(fd) + if options.convert: + pass + else options.convert: + p.prettyPrint(fd) filesParsed += 1 globals.info("%d files have been processed"%filesParsed) diff --git a/source/expatimpl.py b/source/expatimpl.py index 295d88a..9093538 100644 --- a/source/expatimpl.py +++ b/source/expatimpl.py @@ -105,9 +105,6 @@ class Parser: p.CharacterDataHandler = self.character p.Parse(self.strm, 1) - def printSummary (self, fd): - pass - def prettyPrint (self, fd): if len(self.root.children) != 1: return |