| @@ -35,11 +35,12 @@ def convert(origin, target): | |||||
| # print("status:: {0}, output {1}".format(status, output)) | # print("status:: {0}, output {1}".format(status, output)) | ||||
| proc = sp.Popen(args, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE) | proc = sp.Popen(args, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE) | ||||
| y = b'y' | y = b'y' | ||||
| answer = 'Overwrite ? [y/N]' | |||||
| try: | try: | ||||
| outs, errs = proc.communicate(timeout=300) | outs, errs = proc.communicate(timeout=300) | ||||
| if 'Overwrite ? [y/N]' in outs: | |||||
| proc.stdin.write(y) | |||||
| print(outs, errs) | print(outs, errs) | ||||
| if answer in outs: | |||||
| proc.stdin.write(y) | |||||
| if proc.returncode == 0: | if proc.returncode == 0: | ||||
| print("{0} convert {1} Success, origin dat will remove!".format(origin, target)) | print("{0} convert {1} Success, origin dat will remove!".format(origin, target)) | ||||
| os.remove(origin) | os.remove(origin) | ||||
| @@ -55,4 +56,4 @@ if __name__ == "__main__": | |||||
| codec = sys.argv[1] | codec = sys.argv[1] | ||||
| # timeout=sys.argv[2] | # timeout=sys.argv[2] | ||||
| print("codec:: {0}".format(codec)) | print("codec:: {0}".format(codec)) | ||||
| list_folder(DAT_FOLDER, TARGET_FOLDER, codec) | |||||
| list_folder(DAT_FOLDER, TARGET_FOLDER, codec) | |||||