discovery.py
changeset 262 141a7145c099
parent 226 f301f4ed4717
child 277 73890551f021
equal deleted inserted replaced
261:5299c6746fa8 262:141a7145c099
    88         self.SetSizer(sizer)
    88         self.SetSizer(sizer)
    89 
    89 
    90         listmix.ColumnSorterMixin.__init__(self, 4)
    90         listmix.ColumnSorterMixin.__init__(self, 4)
    91 
    91 
    92         #type = "_http._tcp.local."
    92         #type = "_http._tcp.local."
       
    93         self.browser = None
    93         self.zConfInstance = Zeroconf()
    94         self.zConfInstance = Zeroconf()
    94         self.RefreshList()
    95         self.RefreshList()
    95 
    96 
    96     def RefreshList(self):
    97     def RefreshList(self):
    97         type = "_PYRO._tcp.local."
    98         type = "_PYRO._tcp.local."
    98         browser = ServiceBrowser(self.zConfInstance, type, self)        
    99         self.browser = ServiceBrowser(self.zConfInstance, type, self)        
    99 
   100 
   100     def OnRefreshButton(self, event):
   101     def OnRefreshButton(self, event):
   101         self.list.DeleteAllItems()
   102         self.list.DeleteAllItems()
       
   103         self.browser.cancel()
   102         self.RefreshList()
   104         self.RefreshList()
   103 
   105 
   104     # Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py
   106     # Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py
   105     def GetListCtrl(self):
   107     def GetListCtrl(self):
   106         return self.list
   108         return self.list