diff options
| author | 2011-02-13 23:10:00 +0100 | |
|---|---|---|
| committer | 2011-02-13 23:10:00 +0100 | |
| commit | 624b210b8b46e07826762a610dd2d6d7c0b4a121 (patch) | |
| tree | 150365b9122caf0ed8287684416a1818d0153443 | |
| parent | collector size (diff) | |
| download | pyload-624b210b8b46e07826762a610dd2d6d7c0b4a121.tar.xz | |
little SO fix
| -rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 1 | ||||
| -rw-r--r-- | module/remote/thriftbackend/ThriftClient.py | 8 | ||||
| -rwxr-xr-x | pyLoadCore.py | 24 | 
3 files changed, 15 insertions, 18 deletions
| diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 65b02b696..0341a98e4 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -55,6 +55,7 @@ class ShareonlineBiz(Hoster):      def process(self, pyfile):          self.pyfile.url = self.pyfile.url.replace("http://www.share-online.biz/download.php?id=", "http://www.share-online.biz/dl/")          self.pyfile.url = self.pyfile.url.replace("http://share-online.biz/download.php?id=", "http://www.share-online.biz/dl/") +        self.pyfile.url = self.pyfile.url.replace("http://share-online.biz/dl/", "http://www.share-online.biz/dl/")          self.downloadAPIData()          pyfile.name = self.api_data["filename"] diff --git a/module/remote/thriftbackend/ThriftClient.py b/module/remote/thriftbackend/ThriftClient.py index 67474b2bb..16bba7d1f 100644 --- a/module/remote/thriftbackend/ThriftClient.py +++ b/module/remote/thriftbackend/ThriftClient.py @@ -41,7 +41,7 @@ class ThriftClient:                  #connection reset by peer, probably wants ssl                  try:                      self.createConnection(host, port, True) -                    #set timeout or a ssl socket will block when query none ssl server +                    #set timeout or a ssl socket will block when querying none ssl server                      self.socket.setTimeout(10)                  except ImportError: @@ -52,7 +52,7 @@ class ThriftClient:                     correct = self.client.login(user, password)                  finally:                      self.socket.setTimeout(None) -         +          if not correct:              self.transport.close()              raise WrongLogin @@ -64,6 +64,8 @@ class ThriftClient:          protocol = Protocol(self.transport)          self.client = Pyload.Client(protocol) +    def close(self): +        self.transport.close()      def __getattr__(self, item):          return getattr(self.client, item) @@ -81,3 +83,5 @@ if __name__ == "__main__":        data = client.getPackageData(p.pid)        print data        print "Package Name: ", data.name + +    client.close()
\ No newline at end of file diff --git a/pyLoadCore.py b/pyLoadCore.py index 8aeb0a23b..5d11824d7 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -30,22 +30,14 @@ from imp import find_module  import logging  import logging.handlers  import os -from os import _exit -from os import execv -from os import getcwd -from os import makedirs -from os import name as platform -from os import remove -from os import sep +from os import _exit, execv, getcwd, makedirs, remove, sep  from os.path import exists, join  import signal  import subprocess  import sys  from sys import argv, executable, exit -import time -from time import sleep +from time import time, sleep  from traceback import print_exc -from xmlrpclib import Binary  from module import InitHomeDir  from module.plugins.AccountManager import AccountManager @@ -481,7 +473,7 @@ class Core(object):                          exit()      def isClientConnected(self): -        return (self.lastClientConnected + 30) > time.time() +        return (self.lastClientConnected + 30) > time()      def restart(self):          self.shutdown() @@ -756,28 +748,28 @@ class ServerMethods():          self.core.files.setPackageLocation(pid, dest)      def is_captcha_waiting(self): -        self.core.lastClientConnected = time.time() +        self.core.lastClientConnected = time()          task = self.core.captchaManager.getTask()          return not task is None      def get_captcha_task(self, exclusive=False): -        self.core.lastClientConnected = time.time() +        self.core.lastClientConnected = time()          task = self.core.captchaManager.getTask()          if task:              task.setWatingForUser(exclusive=exclusive)              c = task.getCaptcha() -            return str(task.id), Binary(c[0]), str(c[1]) +            return str(task.id), c[0], str(c[1])          else:              return None, None, None      def get_task_status(self, tid): -        self.core.lastClientConnected = time.time() +        self.core.lastClientConnected = time()          t = self.core.captchaManager.getTaskFromID(tid)          if t:              return t.getStatus()      def set_captcha_result(self, tid, result): -        self.core.lastClientConnected = time.time() +        self.core.lastClientConnected = time()          task = self.core.captchaManager.getTaskFromID(tid)          if task:              task.setResult(result) | 
