Skip to content

Commit 14f342e

Browse files
committed
Fixed a problem with appendtables command line param
1 parent dc93ff9 commit 14f342e

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

JMdictToSQLite/JMdictToSQLite.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def parse_cmdline():
4040
parser.add_argument("--jmdictfile", help="path to the .xml JMdict file", default="JMdict_e")
4141
parser.add_argument("--sqlitefile", help="path to the sqlite database to create", required=True)
4242
parser.add_argument("--dbtableprefix", help="prefix of db tables (ex. jmdict)", default="jmdict")
43-
parser.add_argument("--appendtables", help="append tables into an existing database file")
43+
parser.add_argument("--appendtables", help="append tables into an existing database file", action="store_true")
4444
return parser.parse_args()
4545

4646

@@ -305,7 +305,7 @@ def main():
305305
args = parse_cmdline()
306306
appendtables = False
307307

308-
if args.appendtables is not None:
308+
if args.appendtables:
309309
appendtables = True
310310

311311
print("Create database...", end="\n", flush=True)

JMnedictToSQLite/JMnedictToSQLite.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def parse_cmdline():
1313
parser.add_argument("--jmnedictfile", help="path to the .xml JMnedict file", default="JMnedict.xml")
1414
parser.add_argument("--sqlitefile", help="path to the sqlite database to create", required=True)
1515
parser.add_argument("--dbtableprefix", help="prefix of db tables (ex. jmnedict)", default="jmnedict")
16-
parser.add_argument("--appendtables", help="append tables into an existing database file")
16+
parser.add_argument("--appendtables", help="append tables into an existing database file", action="store_true")
1717
return parser.parse_args()
1818

1919

@@ -200,7 +200,7 @@ def main():
200200
args = parse_cmdline()
201201
appendtables = False
202202

203-
if args.appendtables is not None:
203+
if args.appendtables:
204204
appendtables = True
205205

206206
print("Create database...", end="\n", flush=True)

KanjiVGToSQLite/KanjiVGToSQLite.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def parse_cmdline():
3535
parser.add_argument("--kanjivgfile", help="path to the .xml KanjiVG file", default="kanjivg.xml")
3636
parser.add_argument("--sqlitefile", help="path to the sqlite database to create", required=True)
3737
parser.add_argument("--dbtableprefix", help="prefix of db tables (ex. kanjivg)", default="kanjivg")
38-
parser.add_argument("--appendtables", help="append tables into an existing database file")
38+
parser.add_argument("--appendtables", help="append tables into an existing database file", action="store_true")
3939
return parser.parse_args()
4040

4141

@@ -241,7 +241,7 @@ def main():
241241
args = parse_cmdline()
242242
appendtables = False
243243

244-
if args.appendtables is not None:
244+
if args.appendtables:
245245
appendtables = True
246246

247247
print("Create database...", end="\n", flush=True)

Kanjidic2ToSQLite/Kanjidic2ToSQLite.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def parse_cmdline():
1212
parser.add_argument("--kanjidic2file", help="path to the .xml Kanjidic2 file", default="kanjidic2.xml")
1313
parser.add_argument("--sqlitefile", help="path to the sqlite database to create", required=True)
1414
parser.add_argument("--dbtableprefix", help="prefix of db tables (ex. kanjidict)", default="kanjidict")
15-
parser.add_argument("--appendtables", help="append tables into an existing database file")
15+
parser.add_argument("--appendtables", help="append tables into an existing database file", action="store_true")
1616
return parser.parse_args()
1717

1818

@@ -244,7 +244,7 @@ def main():
244244
args = parse_cmdline()
245245
appendtables = False
246246

247-
if args.appendtables is not None:
247+
if args.appendtables:
248248
appendtables = True
249249

250250
print("Create database...", end="\n", flush=True)

KradfileToSQLite/KradfileToSQLite.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def parse_cmdline():
1313
parser.add_argument("--kradfile2", help="path to the kradfile2", default="kradfile2")
1414
parser.add_argument("--sqlitefile", help="path to the sqlite database to create", required=True)
1515
parser.add_argument("--dbtableprefix", help="prefix of db tables (ex. krad)", default="krad")
16-
parser.add_argument("--appendtables", help="append tables into an existing database file")
16+
parser.add_argument("--appendtables", help="append tables into an existing database file", action="store_true")
1717
return parser.parse_args()
1818

1919

@@ -107,7 +107,7 @@ def main():
107107
# Example query for get the list kanji having specific radical
108108
# select data from kanji, kanji_radical where kanji.rowid = kanji_radical.kanji_id and kanji_radical.radical_id = (select rowid from radicals where data = '田')
109109

110-
if args.appendtables is not None:
110+
if args.appendtables:
111111
appendtables = True
112112

113113
kradfile = codecs.open(args.kradfile, 'r', 'euc-jp')

RadkfileToSQLite/RadkfileToSQLite.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def parse_cmdline():
1313
parser.add_argument("--radkfile2", help="path to the radkfile2", default="radkfile2")
1414
parser.add_argument("--sqlitefile", help="path to the sqlite database to create", required=True)
1515
parser.add_argument("--dbtableprefix", help="prefix of db tables (ex. radk)", default="radk")
16-
parser.add_argument("--appendtables", help="append tables into an existing database file")
16+
parser.add_argument("--appendtables", help="append tables into an existing database file", action="store_true")
1717
return parser.parse_args()
1818

1919

@@ -124,7 +124,7 @@ def main():
124124
# Example query for get the list kanji having specific radical
125125
# select data from kanji, kanji_radical where kanji.rowid = kanji_radical.kanji_id and kanji_radical.radical_id = (select rowid from radicals where data = '田')
126126

127-
if args.appendtables is not None:
127+
if args.appendtables:
128128
appendtables = True
129129

130130
radkfile = codecs.open(args.radkfile, 'r', 'euc-jp')

0 commit comments

Comments
 (0)