touching up
This commit is contained in:
parent
1ef41a3d6d
commit
c36667cf57
@ -13,8 +13,7 @@ _exit = exit;
|
||||
exit = sys.exit;
|
||||
|
||||
def printf(s, *args):
|
||||
printing = s if len(args) == 0 else (s % args);
|
||||
return sys.stdout.write(printing);
|
||||
return fprintf(stdout, s, *args);
|
||||
|
||||
def fprintf(f, s, *args):
|
||||
printing = s if len(args) == 0 else (s % args);
|
||||
@ -64,9 +63,12 @@ def main(argc, argv):
|
||||
except KeyboardInterrupt:
|
||||
fprintf(stderr, "%s: Cancelled (keyboard interrupt).\n", argv[0]);
|
||||
exit(1);
|
||||
for i in range(len(text)):
|
||||
text[i] = translator.translate(text[i], src=src, dest=dest);
|
||||
for translation in text:
|
||||
for line in text:
|
||||
try:
|
||||
translation = translator.translate(line, src=src, dest=dest);
|
||||
except:
|
||||
fprintf(stderr, "%s: %s ->%s\n\t%s\n",
|
||||
argv[0], line, dest, "Error trying to translate.");
|
||||
if isatty:
|
||||
fprintf(stdout,
|
||||
"%s -> %s\n"
|
||||
|
Loading…
Reference in New Issue
Block a user