diff options
-rwxr-xr-x | pyLoadCli.py | 13 | ||||
-rwxr-xr-x | pyLoadCore.py | 12 | ||||
-rwxr-xr-x | pyLoadGui.py | 11 |
3 files changed, 5 insertions, 31 deletions
diff --git a/pyLoadCli.py b/pyLoadCli.py index e4238b28d..3f5e41257 100755 --- a/pyLoadCli.py +++ b/pyLoadCli.py @@ -96,7 +96,7 @@ class pyLoadCli: return str(size / 1024) + " MiB" def println(self, line, content): - print "\033[" + str(line) + ";0H\033[2K" + str(content) + "\033[" + str((self.inputline if self.inputline > 0 else self.inputline + 1) - 1) + ";0H" + print "\033[" + unicode(line) + ";0H\033[2K" + unicode(content) + "\033[" + unicode((self.inputline if self.inputline > 0 else self.inputline + 1) - 1) + ";0H" def print_input(self): self.println(self.inputline, white(" Input: ") + self.input) @@ -431,16 +431,7 @@ if __name__ == "__main__": config = xmlconfig.getConfig() translation = gettext.translation("pyLoadCli", join(abspath(dirname(__file__)), "locale"), languages=[config['general']['language']]) - - try: - translation.ugettext("äöü") - unicode = True - except: - unicode = False - - #@TODO cleaner method, if possible - - translation.install(unicode) + translation.install(unicode=(False if sys.stdout.encoding == "ascii" else True)) if len(sys.argv) > 1: diff --git a/pyLoadCore.py b/pyLoadCore.py index 01646212f..b2ee524a6 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -110,15 +110,7 @@ class Core(object): self.do_kill = False self.do_restart = False translation = gettext.translation("pyLoad", self.make_path("locale"), languages=[self.config['general']['language']]) - try: - translation.ugettext("äöü") - unicode = True - except: - unicode = False - - #@TODO cleaner method, if possible - - translation.install(unicode) + translation.install(unicode=(False if sys.stdout.encoding == "ascii" else True)) self.check_install("Crypto", _("pycrypto to decode container files")) self.check_install("Image", _("Python Image Libary (PIL) for captha reading")) @@ -641,4 +633,4 @@ if __name__ == "__main__": except KeyboardInterrupt: pyload_core.shutdown() pyload_core.logger.info(_("killed pyLoad from Terminal")) - exit()
\ No newline at end of file + exit() diff --git a/pyLoadGui.py b/pyLoadGui.py index b4a518036..5cf36242d 100755 --- a/pyLoadGui.py +++ b/pyLoadGui.py @@ -59,16 +59,7 @@ class main(QObject): lang = parser.xml.elementsByTagName("language").item(0).toElement().text() translation = gettext.translation("pyLoadGui", join(dirname(__file__), "locale"), languages=[str(lang)]) - - try: - translation.ugettext("äöü") - unicode = True - except: - unicode = False - - #@TODO cleaner method, if possible - - translation.install(unicode) + translation.install(unicode=(False if sys.stdout.encoding == "ascii" else True)) self.mainWindow = MainWindow() self.pwWindow = PWInputWindow() |