summaryrefslogtreecommitdiffstats
path: root/module/gui/connector.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-02-02 22:19:59 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2010-02-02 22:19:59 +0100
commit99da0e18722d9343a274e9a96376969a469e3a95 (patch)
treeb612118af4ed934c46d46500960b3ec16f2c09a0 /module/gui/connector.py
parentFixed time compare thanks prophy (diff)
parentmerge (diff)
downloadpyload-99da0e18722d9343a274e9a96376969a469e3a95.tar.xz
merge no2
Diffstat (limited to 'module/gui/connector.py')
-rw-r--r--module/gui/connector.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/module/gui/connector.py b/module/gui/connector.py
index 432999161..b6c383956 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,9 +127,12 @@ 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)
+ #self.emit(SIGNAL("proxy_error"), "getLinkInfo", e)
+ return None
finally:
self.mutex.unlock()
@@ -421,4 +427,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()