Author: dmeyer
Date: Sat Mar 25 19:40:53 2006
New Revision: 1347
Modified:
trunk/beacon/src/__init__.py
trunk/beacon/src/client.py
Log:
fix client shutdown
Modified: trunk/beacon/src/__init__.py
==============================================================================
--- trunk/beacon/src/__init__.py (original)
+++ trunk/beacon/src/__init__.py Sat Mar 25 19:40:53 2006
@@ -34,7 +34,6 @@
import os
import logging
-from kaa import ipc
from client import Client
import thumbnail
from thumbnail import Thumbnail, NORMAL, LARGE
Modified: trunk/beacon/src/client.py
==============================================================================
--- trunk/beacon/src/client.py (original)
+++ trunk/beacon/src/client.py Sat Mar 25 19:40:53 2006
@@ -42,7 +42,8 @@
import logging
# kaa imports
-from kaa import ipc
+import kaa
+import kaa.ipc
from kaa.weakref import weakref
from kaa.notifier import OneShotTimer
@@ -62,7 +63,7 @@
def __init__(self, db):
db = os.path.abspath(db)
# monitor function from the server to start a new monitor for a query
- self._server = ipc.IPCClient('beacon').get_object('beacon')(db)
+ self._server = kaa.ipc.IPCClient('beacon').get_object('beacon')(db)
self._server_monitor = self._server.monitor
# read only version of the database
self.database = Database(db, self)
@@ -72,8 +73,22 @@
self._queries = []
# internal list of items to update
self._changed = []
-
+ # add ourself to shutdown handler for correct disconnect
+ kaa.signals['shutdown'].connect(self.disconnect)
+
+ def disconnect(self):
+ """
+ Disconnect from the server.
+ """
+ for q in self._queries:
+ q._monitor = False
+ self._queries = []
+ self._server = None
+ self._server_monitor = None
+ self.database = None
+
+
def add_mountpoint(self, device, directory):
"""
Add a mountpoint to the system.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog