X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=scripts%2Fmysql2sql;h=cacbafa13444ea26898b5dcca80b065784fad485;hb=2c9d316a8af92358221bada1361176e1bb227401;hp=7e29c2e4f1ced3ede855624cf23cfcfafeb36418;hpb=6e7b1489547b4fd5bd5faf49b1172b68fc14a257;p=sqlconvert.git diff --git a/scripts/mysql2sql b/scripts/mysql2sql index 7e29c2e..cacbafa 100755 --- a/scripts/mysql2sql +++ b/scripts/mysql2sql @@ -32,8 +32,11 @@ def main(infile, encoding, outfile, output_encoding, use_pbar, quoting_style): use_pbar = False if use_pbar: - print("Converting: ", end='', file=sys.stderr) - sys.stderr.flush() + print("Converting", end='', file=sys.stderr) + if infile.name != '': + print(' ' + infile.name, end='', file=sys.stderr) + print(": ", end='', file=sys.stderr) + sys.stderr.flush() if use_pbar: pbar = ttyProgressBar(0, size-1) @@ -57,8 +60,8 @@ def main(infile, encoding, outfile, output_encoding, use_pbar, quoting_style): got_directive = is_directive_statement(statement) if got_directive: continue - for statement in process_statement(statement, quoting_style): - print_tokens(statement, outfile=outfile, + for _statement in process_statement(statement, quoting_style): + print_tokens(_statement, outfile=outfile, encoding=output_encoding) tokens = grouper.close() if tokens: