diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-30 11:45:32 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-30 11:45:32 +0200 |
commit | 367b5b21ff2aa72776d327286e6dd7fca9af59d8 (patch) | |
tree | 27ef13452705721af97de6c9c93b59dd6b1cb974 /pyLoadCli.py | |
parent | moved interfaces (diff) | |
download | pyload-367b5b21ff2aa72776d327286e6dd7fca9af59d8.tar.xz |
encoding fixes
Diffstat (limited to 'pyLoadCli.py')
-rwxr-xr-x | pyLoadCli.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/pyLoadCli.py b/pyLoadCli.py index 1bfae7238..bab5c360e 100755 --- a/pyLoadCli.py +++ b/pyLoadCli.py @@ -24,8 +24,6 @@ from itertools import islice import os import os.path from os.path import join -from os.path import abspath -from os.path import dirname import sys from sys import exit import threading @@ -34,14 +32,12 @@ from time import sleep import xmlrpclib from traceback import print_exc +from codecs import getwriter +sys.stdout = getwriter("utf8")(sys.stdout, errors = "replace") from module import InitHomeDir from module.ConfigParser import ConfigParser -import codecs - -sys.stdout = codecs.getwriter("utf8")(sys.stdout, errors = "replace") - if sys.stdout.encoding.lower().startswith("utf"): conv = unicode else: @@ -474,7 +470,7 @@ if __name__ == "__main__": config = ConfigParser() translation = gettext.translation("pyLoadCli", join(pypath, "locale"), languages=[config['general']['language']]) - translation.install(unicode=(True if sys.stdout.encoding.lower().startswith("utf") else False)) + translation.install(unicode=True) server_url = "" username = "" @@ -547,7 +543,6 @@ if __name__ == "__main__": server_url = "http%s://%s:%s@%s:%s/" % (ssl, username, password, addr, port) - print server_url if add: cli = pyLoadCli(server_url, add) else: |