Skip to content

Commit

Permalink
hwp5odt: --document option (close #70)
Browse files Browse the repository at this point in the history
  • Loading branch information
mete0r committed Jun 18, 2013
1 parent ea1e85f commit bc1f31e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
16 changes: 0 additions & 16 deletions bin/hwp5fodt

This file was deleted.

8 changes: 7 additions & 1 deletion pyhwp/hwp5/hwp5odt.py
Expand Up @@ -21,6 +21,7 @@
Usage::
hwp5odt [options] [--embed-image] <hwp5file>
hwp5odt [options] --document [--no-embed-image] <hwp5file>
hwp5odt -h | --help
hwp5odt --version
Expand All @@ -30,6 +31,8 @@
--version Show version
--loglevel=<level> Set log level.
--logfile=<file> Set log file.
--document Produce single OpenDocument XML file (.fodt)
'''
from __future__ import with_statement
import os
Expand Down Expand Up @@ -72,7 +75,10 @@ def main():
if rng is None:
logger.warning('no RelaxNG implementation is available.')

convert = ODTPackageConverter(xslt, rng, args['--embed-image'])
if args['--document']:
convert = ODTSingleDocumentConverter(xslt, rng, not args['--no-embed-image'])
else:
convert = ODTPackageConverter(xslt, rng, args['--embed-image'])

hwpfilename = args['<hwp5file>']
root = os.path.basename(hwpfilename)
Expand Down

0 comments on commit bc1f31e

Please sign in to comment.