summaryrefslogtreecommitdiffstats
path: root/module/gui/connector.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-29 16:50:13 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-29 16:50:13 +0100
commitfa9cce4987da585f5bf21274cfbe5f046f46f703 (patch)
tree94fa0f16d8b72b09c1e59d27d2bb70aeed3c09ff /module/gui/connector.py
parentUploadedTo indirect download fix (diff)
downloadpyload-fa9cce4987da585f5bf21274cfbe5f046f46f703.tar.xz
: Bitte gib eine Versions-Meldung ein. Zeilen beginnend mit 'HG:' werden entfernt.
Diffstat (limited to 'module/gui/connector.py')
-rw-r--r--module/gui/connector.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/module/gui/connector.py b/module/gui/connector.py
index 8a2909c5e..2915cf568 100644
--- a/module/gui/connector.py
+++ b/module/gui/connector.py
@@ -51,11 +51,14 @@ class connector(QThread):
start thread
(called from thread.start())
"""
- self.connectProxy(self.addr)
+ self.canConnect()
while self.running:
sleep(1)
self.getError()
+ def canConnect(self):
+ return self.connectProxy(self.addr)
+
def stop(self):
"""
stop thread
@@ -67,9 +70,14 @@ class connector(QThread):
connect to remote server
"""
self.proxy = ServerProxy(addr, allow_none=True)
- server_version = self.proxy.get_server_version()
+ try:
+ server_version = self.proxy.get_server_version()
+ except:
+ return False
if not server_version == SERVER_VERSION:
self.emit(SIGNAL("error_box"), "server is version %s client accepts version %s" % (server_version, SERVER_VERSION))
+ return False
+ return True
def _proxyError(self, func, e):
"""
@@ -365,4 +373,16 @@ class connector(QThread):
self.emit(SIGNAL("proxy_error"), "setPackageName", e)
finally:
self.mutex.unlock()
+
+ def slotPullOutPackage(self, pid):
+ """
+ pull out package
+ """
+ self.mutex.lock()
+ try:
+ return self.proxy.pull_out_package(pid)
+ except Exception, e:
+ self.emit(SIGNAL("proxy_error"), "slotPullOutPackage", e)
+ finally:
+ self.mutex.unlock()