3 """Script for converting KANJIDIC2 to SQLite."""
6 from jblite
.kd2
import KD2Converter
7 from jblite
.jmdict
import JMdictConverter
9 gettext
.install("jblite")
13 usage
="usage: %prog [options] <xml_src> <sqlite_dest>"
14 op
= optparse
.OptionParser(usage
)
15 op
.add_option("-v", "--verbose", action
="store_true",
16 help=_("Display verbose output (default: %default)"))
17 op
.add_option("-f", "--format",
18 help=_("Format of database file (kanjidic2, jmdict) "
19 "(default: %default)"))
20 op
.set_defaults(verbose
=False,
22 return op
.parse_args()
25 (options
, args
) = parse_args()
26 src_fname
, dest_fname
= args
[:2]
28 "kanjidic2": KD2Converter
,
29 "jmdict": JMdictConverter
,
31 cls
= formats
[options
.format
]
32 converter
= cls(src_fname
, dest_fname
, verbose
=options
.verbose
)
35 if __name__
== "__main__":