discovery.py
changeset 262 141a7145c099
parent 226 f301f4ed4717
child 277 73890551f021
--- a/discovery.py	Wed Oct 22 14:22:54 2008 +0200
+++ b/discovery.py	Fri Oct 24 14:01:36 2008 +0200
@@ -90,15 +90,17 @@
         listmix.ColumnSorterMixin.__init__(self, 4)
 
         #type = "_http._tcp.local."
+        self.browser = None
         self.zConfInstance = Zeroconf()
         self.RefreshList()
 
     def RefreshList(self):
         type = "_PYRO._tcp.local."
-        browser = ServiceBrowser(self.zConfInstance, type, self)        
+        self.browser = ServiceBrowser(self.zConfInstance, type, self)        
 
     def OnRefreshButton(self, event):
         self.list.DeleteAllItems()
+        self.browser.cancel()
         self.RefreshList()
 
     # Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py
@@ -144,7 +146,7 @@
     def removeService(self, zeroconf, type, name):
         pass
 	
-    def addService(self, zeroconf, type, name):
+    def addService(self, zeroconf, type, name):
         info = self.zConfInstance.getServiceInfo(type, name)
         typename = type.split(".")[0][1:]
         num_items = self.list.GetItemCount()