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