|
|
@@ -34,14 +34,13 @@ def convert(origin, target): |
|
|
|
# status, output = sp.getstatusoutput(cmd)
|
|
|
|
# print("status:: {0}, output {1}".format(status, output))
|
|
|
|
proc = sp.Popen(args, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)
|
|
|
|
answer = 'Overwrite ? [y/N]'
|
|
|
|
answer = b'Overwrite ? [y/N]'
|
|
|
|
try:
|
|
|
|
outs, errs = proc.communicate(timeout=300)
|
|
|
|
ret_info = str(outs, encoding='utf-8')
|
|
|
|
print(ret_info, errs)
|
|
|
|
print(outs, errs)
|
|
|
|
if answer in ret_info:
|
|
|
|
proc.stdin.write(b'y')
|
|
|
|
elif proc.returncode == 0:
|
|
|
|
if proc.returncode == 0:
|
|
|
|
print("{0} convert {1} Success, origin dat will remove!".format(origin, target))
|
|
|
|
os.remove(origin)
|
|
|
|
else:
|
|
|
|