diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-06-27 22:22:40 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-06-27 22:22:40 +0200 |
commit | eb15310543e8ae5bca3b164e538af6386dd72c24 (patch) | |
tree | 3970d97291a9ce5fb705e6fcd9efe229348e59e5 /pyLoadCli.py | |
parent | closed #345 (diff) | |
download | pyload-eb15310543e8ae5bca3b164e538af6386dd72c24.tar.xz |
little cli improvement
Diffstat (limited to 'pyLoadCli.py')
-rwxr-xr-x[-rw-r--r--] | pyLoadCli.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pyLoadCli.py b/pyLoadCli.py index 29f39656b..12e601029 100644..100755 --- a/pyLoadCli.py +++ b/pyLoadCli.py @@ -31,8 +31,12 @@ from time import sleep from traceback import print_exc from codecs import getwriter +if os.name == "nt": + enc = "cp850" +else: + enc = "utf8" -sys.stdout = getwriter("utf8")(sys.stdout, errors="replace") +sys.stdout = getwriter(enc)(sys.stdout, errors = "replace") from module import InitHomeDir from module.cli.printer import * @@ -50,6 +54,7 @@ class Cli: self.command = command if not self.command: + renameProcess('pyLoadCli') self.getch = Getch() self.input = "" self.inputline = 0 @@ -264,9 +269,11 @@ class Cli: print "\tDownloading: %s @ %s/s\t %s (%s%%)" % ( download.format_eta, formatSize(download.speed), formatSize(download.size - download.bleft), download.percent) - if download.status == 5: + elif download.status == 5: print print_status(download) print "\tWaiting: %s" % download.format_wait + else: + print print_status(download) elif command == "queue": print_packages(self.client.getQueueData()) @@ -428,7 +435,6 @@ def writeConfig(opts): print _("Couldn't write user config file") if __name__ == "__main__": - renameProcess('pyLoadCli') config = {"addr": "127.0.0.1", "port": "7227", "language": "en"} try: config["language"] = os.environ["LANG"][0:2] |