summaryrefslogtreecommitdiffstats
path: root/pyload/cli/Cli.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-01 18:11:25 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-01 18:11:25 +0200
commitc126f738bd5be581d5321521eedc9b14a8165a0e (patch)
tree418989bfa81bfd30085f09102df53f6f58b00f14 /pyload/cli/Cli.py
parentUse 'import' instead 'from' (1) (diff)
downloadpyload-c126f738bd5be581d5321521eedc9b14a8165a0e.tar.xz
Use 'import' instead 'from' (2)
Diffstat (limited to 'pyload/cli/Cli.py')
-rw-r--r--pyload/cli/Cli.py40
1 files changed, 15 insertions, 25 deletions
diff --git a/pyload/cli/Cli.py b/pyload/cli/Cli.py
index fc5236ff9..812212d31 100644
--- a/pyload/cli/Cli.py
+++ b/pyload/cli/Cli.py
@@ -3,39 +3,29 @@
from __future__ import with_statement
-from getopt import GetoptError, getopt
+import os
+import sys
+import threading
+import traceback
import pyload.utils.pylgettext as gettext
-import os
+
+from codecs import getwriter
+from getopt import GetoptError, getopt
from os import _exit
from os.path import join, exists, basename
-import sys
from sys import exit
-from threading import Thread, Lock
from time import sleep
-from traceback import print_exc
-
-from pyload.config.Parser import ConfigParser
-
-from codecs import getwriter
-import module.common.pylgettext as gettext
-
-if os.name == "nt":
- enc = "cp850"
-else:
- enc = "utf8"
-
-sys.stdout = getwriter(enc)(sys.stdout, errors="replace")
-
-from pyload.cli.printer import *
-from pyload.cli import AddPackage, ManageFiles
+from Getch import Getch
+from rename_process import renameProcess
from pyload.api import Destination
-from pyload.utils import formatSize, decode
+from pyload.cli import AddPackage, ManageFiles
+from pyload.config.Parser import ConfigParser
from pyload.remote.thriftbackend.ThriftClient import ThriftClient, NoConnection, NoSSL, WrongLogin, ConnectionClosed
-from Getch import Getch
-from rename_process import renameProcess
+from pyload.utils import formatSize, decode
+from pyload.utils.printer import *
class Cli(object):
@@ -52,7 +42,7 @@ class Cli(object):
self.lastLowestLine = 0
self.menuline = 0
- self.lock = Lock()
+ self.lock = threading.Lock()
# processor funcions, these will be changed dynamically depending on control flow
self.headerHandler = self #: the download status
@@ -389,7 +379,7 @@ class RefreshThread(Thread):
except Exception, e:
println(2, red(str(e)))
self.cli.reset()
- print_exc()
+ traceback.print_exc()
def print_help(config):