diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-12 02:17:30 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-12 03:22:32 +0200 |
commit | 000426c9d890ba2a71625a7454f9c573f10b9bae (patch) | |
tree | 8fa66da5061b850778f72f84038d9bb8bfa31f2f /pyload/remote/thriftbackend | |
parent | 'from os' -> 'import os' and so on... (diff) | |
download | pyload-000426c9d890ba2a71625a7454f9c573f10b9bae.tar.xz |
'from time' -> 'import time' and so on...
Diffstat (limited to 'pyload/remote/thriftbackend')
-rw-r--r-- | pyload/remote/thriftbackend/Socket.py | 7 | ||||
-rw-r--r-- | pyload/remote/thriftbackend/ThriftTest.py | 12 | ||||
-rw-r--r-- | pyload/remote/thriftbackend/thriftgen/pyload/Pyload-remote | 5 |
3 files changed, 9 insertions, 15 deletions
diff --git a/pyload/remote/thriftbackend/Socket.py b/pyload/remote/thriftbackend/Socket.py index 0ca9ed178..6459d8f79 100644 --- a/pyload/remote/thriftbackend/Socket.py +++ b/pyload/remote/thriftbackend/Socket.py @@ -3,8 +3,7 @@ import sys import socket import errno - -from time import sleep +import time from thrift.transport.TSocket import TSocket, TServerSocket, TTransportException @@ -38,7 +37,7 @@ class SecureSocketConnection(object): try: return self.__dict__['connection'].send(buff) except WantReadError: - sleep(0.1) + time.sleep(0.1) return self.send(buff) @@ -46,7 +45,7 @@ class SecureSocketConnection(object): try: return self.__dict__['connection'].recv(buff) except WantReadError: - sleep(0.1) + time.sleep(0.1) return self.recv(buff) diff --git a/pyload/remote/thriftbackend/ThriftTest.py b/pyload/remote/thriftbackend/ThriftTest.py index c95e060b8..d8adf476e 100644 --- a/pyload/remote/thriftbackend/ThriftTest.py +++ b/pyload/remote/thriftbackend/ThriftTest.py @@ -3,11 +3,7 @@ import os import platform import sys - -if "64" in platform.machine(): - sys.path.append(os.path.join(pypath, "lib64")) -sys.path.append(os.path.join(pypath, "lib", "Python", "Lib")) - +import time from pyload.remote.thriftbackend.thriftgen.pyload import Pyload from pyload.remote.thriftbackend.thriftgen.pyload.ttypes import * @@ -18,15 +14,13 @@ from thrift.transport import TTransport from Protocol import Protocol -from time import time - import xmlrpclib def bench(f, *args, **kwargs): - s = time() + s = time.time() ret = [f(*args, **kwargs) for _i in xrange(0, 100)] - e = time() + e = time.time() try: print "%s: %f s" % (f._Method__name, e-s) except Exception: diff --git a/pyload/remote/thriftbackend/thriftgen/pyload/Pyload-remote b/pyload/remote/thriftbackend/thriftgen/pyload/Pyload-remote index ddc1dd451..beab520e2 100644 --- a/pyload/remote/thriftbackend/thriftgen/pyload/Pyload-remote +++ b/pyload/remote/thriftbackend/thriftgen/pyload/Pyload-remote @@ -8,7 +8,8 @@ import sys import pprint -from urlparse import urlparse +import urlparse + from thrift.transport import TTransport from thrift.transport import TSocket from thrift.transport import THttpClient @@ -111,7 +112,7 @@ if sys.argv[argi] == '-h': argi += 2 if sys.argv[argi] == '-u': - url = urlparse(sys.argv[argi+1]) + url = urlparse.urlparse(sys.argv[argi+1]) parts = url[1].split(':') host = parts[0] if len(parts) > 1: |