summaryrefslogtreecommitdiffstats
path: root/pyLoadCli.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-02-11 17:27:22 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2010-02-11 17:27:22 +0100
commit2e844dbabf8b17390ebdb2159cace48cfdd19a34 (patch)
treea3e8bc4cd46ac700bb2de0221b6c70f7ff1a5d28 /pyLoadCli.py
parentcnl, EOL, path fixes (diff)
downloadpyload-2e844dbabf8b17390ebdb2159cace48cfdd19a34.tar.xz
locale fix
Diffstat (limited to 'pyLoadCli.py')
-rwxr-xr-xpyLoadCli.py13
1 files changed, 2 insertions, 11 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: