diff options
author | mkaay <mkaay@mkaay.de> | 2010-02-01 18:54:19 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-02-01 18:54:19 +0100 |
commit | 5d04894e73a52e69968cb4a4bfd9a581cd2fb86c (patch) | |
tree | 648c782dd85d3905f1162b4914a87262f92487be /module/gui/connector.py | |
parent | clean + strip (diff) | |
download | pyload-5d04894e73a52e69968cb4a4bfd9a581cd2fb86c.tar.xz |
new update system for remote clients
Diffstat (limited to 'module/gui/connector.py')
-rw-r--r-- | module/gui/connector.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/module/gui/connector.py b/module/gui/connector.py index 432999161..3146ecf5b 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -19,6 +19,7 @@ SERVER_VERSION = "0.3" from time import sleep +from uuid import uuid4 as uuid from PyQt4.QtCore import * from PyQt4.QtGui import * @@ -35,6 +36,7 @@ class connector(QThread): self.running = True self.proxy = None self.addr = None + self.connectionID = None self.errorQueue = [] self.connect(self, SIGNAL("proxy_error"), self._proxyError) @@ -72,6 +74,7 @@ class connector(QThread): self.proxy = ServerProxy(addr, allow_none=True) try: server_version = self.proxy.get_server_version() + self.connectionID = uuid().hex except: return False if not server_version == SERVER_VERSION: @@ -124,7 +127,9 @@ class connector(QThread): """ self.mutex.lock() try: - return self.proxy.get_file_info(id) + info = self.proxy.get_file_info(id) + info["downloading"] = None + return info except Exception, e: self.emit(SIGNAL("proxy_error"), "getLinkInfo", e) finally: @@ -421,4 +426,16 @@ class connector(QThread): self.emit(SIGNAL("proxy_error"), "setCaptchaResult", e) finally: self.mutex.unlock() + + def getEvents(self): + """ + get events + """ + self.mutex.lock() + try: + return self.proxy.get_events(self.connectionID) + except Exception, e: + self.emit(SIGNAL("proxy_error"), "getEvents", e) + finally: + self.mutex.unlock() |