def main():
results = arg_parser.parse_args()
if re.match('^.+\.sqlite$', results.database):
results.database = re.sub('^(.+)\.sqlite$', '\\1', results.database)
try:
json_filenames = results.file if results.file else \
[f.path for f in scandir() if f.is_file() and
os.path.splitext(f.path)[1].lower() == '.json']
if not json_filenames:
raise NoFilesProvidedError
except NoFilesProvidedError:
sys.exit(2)
else:
edb = EDataSQLDatabase(database=results.database,
verbose=results.verbose)
for f in [f for f in json_filenames if check_file(f)]:
edb.import_file(f)
评论列表
文章目录