author | laurent |
Thu, 03 Sep 2009 11:28:46 +0200 | |
changeset 387 | 2cc48e356902 |
parent 379 | 71c441104cac |
child 392 | 6617d3fb43e2 |
permissions | -rwxr-xr-x |
203 | 1 |
# -*- coding: utf-8 -*- |
2 |
||
3 |
#This file is part of Beremiz, a Integrated Development Environment for |
|
4 |
#programming IEC 61131-3 automates supporting plcopen standard and CanFestival. |
|
5 |
# |
|
6 |
#Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD |
|
7 |
# |
|
8 |
#See COPYING file for copyrights details. |
|
9 |
# |
|
10 |
#This library is free software; you can redistribute it and/or |
|
11 |
#modify it under the terms of the GNU General Public |
|
12 |
#License as published by the Free Software Foundation; either |
|
13 |
#version 2.1 of the License, or (at your option) any later version. |
|
14 |
# |
|
15 |
#This library is distributed in the hope that it will be useful, |
|
16 |
#but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
17 |
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
18 |
#General Public License for more details. |
|
19 |
# |
|
20 |
#You should have received a copy of the GNU General Public |
|
21 |
#License along with this library; if not, write to the Free Software |
|
22 |
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
23 |
||
24 |
import wx |
|
357
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
25 |
from Zeroconf import * |
203 | 26 |
import socket |
27 |
import wx.lib.mixins.listctrl as listmix |
|
28 |
||
375
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
29 |
class AutoWidthListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin): |
203 | 30 |
def __init__(self, parent, ID, pos=wx.DefaultPosition, |
31 |
size=wx.DefaultSize, style=0): |
|
32 |
wx.ListCtrl.__init__(self, parent, ID, pos, size, style) |
|
33 |
listmix.ListCtrlAutoWidthMixin.__init__(self) |
|
34 |
||
35 |
class DiscoveryDialog(wx.Dialog, listmix.ColumnSorterMixin): |
|
361 | 36 |
def __init__(self, parent, id=-1, title=_('Service Discovery')): |
203 | 37 |
self.my_result=None |
38 |
wx.Dialog.__init__(self, parent, id, title, size=(600,600), style=wx.DEFAULT_DIALOG_STYLE) |
|
39 |
||
375
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
40 |
# set up dialog sizer |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
41 |
|
221 | 42 |
sizer = wx.FlexGridSizer(2, 1, 2, 2) # rows, cols, vgap, hgap |
43 |
sizer.AddGrowableRow(0) |
|
44 |
sizer.AddGrowableCol(0) |
|
45 |
||
375
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
46 |
# set up list control |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
47 |
|
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
48 |
self.list = AutoWidthListCtrl(self, -1, |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
49 |
#pos=(50,20), |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
50 |
#size=(500,300), |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
51 |
style=wx.LC_REPORT |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
52 |
| wx.LC_EDIT_LABELS |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
53 |
| wx.LC_SORT_ASCENDING |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
54 |
| wx.LC_SINGLE_SEL |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
55 |
) |
221 | 56 |
sizer.Add(self.list, 1, wx.EXPAND) |
57 |
||
58 |
btsizer = wx.FlexGridSizer(1, 6, 2, 2) # rows, cols, vgap, hgap |
|
59 |
||
60 |
sizer.Add(btsizer, 1, wx.EXPAND) |
|
61 |
||
203 | 62 |
self.PopulateList() |
63 |
||
64 |
self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self.list) |
|
65 |
self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, self.list) |
|
66 |
||
375
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
67 |
# set up buttons |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
68 |
|
221 | 69 |
local_id = wx.NewId() |
361 | 70 |
b = wx.Button(self, local_id, _("Refresh")) |
221 | 71 |
self.Bind(wx.EVT_BUTTON, self.OnRefreshButton, b) |
72 |
btsizer.Add(b) |
|
203 | 73 |
|
221 | 74 |
btsizer.AddSpacer(0) |
75 |
btsizer.AddGrowableCol(1) |
|
203 | 76 |
|
221 | 77 |
local_id = wx.NewId() |
361 | 78 |
b = wx.Button(self, local_id, _("Local")) |
221 | 79 |
self.Bind(wx.EVT_BUTTON, self.ChooseLocalID, b) |
80 |
btsizer.Add(b) |
|
81 |
||
82 |
btsizer.AddSpacer(0) |
|
83 |
btsizer.AddGrowableCol(3) |
|
84 |
||
361 | 85 |
b = wx.Button(self, wx.ID_CANCEL, _("Cancel")) |
357
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
86 |
self.Bind(wx.EVT_BUTTON, self.OnCancel, b) |
221 | 87 |
btsizer.Add(b) |
88 |
||
361 | 89 |
b = wx.Button(self, wx.ID_OK, _("OK")) |
357
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
90 |
self.Bind(wx.EVT_BUTTON, self.OnOk, b) |
221 | 91 |
b.SetDefault() |
92 |
btsizer.Add(b) |
|
93 |
||
94 |
self.SetSizer(sizer) |
|
203 | 95 |
|
96 |
listmix.ColumnSorterMixin.__init__(self, 4) |
|
221 | 97 |
|
375
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
98 |
# Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
99 |
self.itemDataMap = {} |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
100 |
|
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
101 |
# a counter used to assign a unique id to each listctrl item |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
102 |
self.nextItemId = 0 |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
103 |
|
262 | 104 |
self.browser = None |
221 | 105 |
self.zConfInstance = Zeroconf() |
106 |
self.RefreshList() |
|
107 |
||
357
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
108 |
self.Bind(wx.EVT_CLOSE, self.OnClose) |
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
109 |
|
221 | 110 |
def RefreshList(self): |
377
9db62e0280f5
remove code that i was using for testing.
b.taylor@willowglen.ca
parents:
375
diff
changeset
|
111 |
type = "_PYRO._tcp.local." |
262 | 112 |
self.browser = ServiceBrowser(self.zConfInstance, type, self) |
221 | 113 |
|
114 |
def OnRefreshButton(self, event): |
|
115 |
self.list.DeleteAllItems() |
|
262 | 116 |
self.browser.cancel() |
221 | 117 |
self.RefreshList() |
118 |
||
357
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
119 |
def OnClose(self, event): |
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
120 |
self.zConfInstance.close() |
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
121 |
event.Skip() |
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
122 |
|
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
123 |
def OnCancel(self, event): |
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
124 |
self.zConfInstance.close() |
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
125 |
event.Skip() |
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
126 |
|
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
127 |
def OnOk(self, event): |
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
128 |
self.zConfInstance.close() |
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
129 |
event.Skip() |
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
130 |
|
203 | 131 |
# Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py |
132 |
def GetListCtrl(self): |
|
133 |
return self.list |
|
134 |
||
135 |
def PopulateList(self): |
|
221 | 136 |
self.list.InsertColumn(0, 'NAME') |
203 | 137 |
self.list.InsertColumn(1, 'TYPE') |
138 |
self.list.InsertColumn(2, 'IP') |
|
139 |
self.list.InsertColumn(3, 'PORT') |
|
140 |
self.list.SetColumnWidth(0, 150) |
|
141 |
self.list.SetColumnWidth(1, 150) |
|
142 |
self.list.SetColumnWidth(2, 150) |
|
143 |
self.list.SetColumnWidth(3, 150) |
|
144 |
||
145 |
def getColumnText(self, index, col): |
|
146 |
item = self.list.GetItem(index, col) |
|
147 |
return item.GetText() |
|
148 |
||
149 |
def OnItemSelected(self, event): |
|
150 |
self.currentItem = event.m_itemIndex |
|
221 | 151 |
self.setresult() |
203 | 152 |
event.Skip() |
153 |
||
154 |
def OnItemActivated(self, event): |
|
155 |
self.currentItem = event.m_itemIndex |
|
221 | 156 |
self.setresult() |
157 |
self.Close() |
|
203 | 158 |
event.Skip() |
159 |
||
221 | 160 |
def setresult(self): |
203 | 161 |
connect_type = self.getColumnText(self.currentItem, 1) |
162 |
connect_address = self.getColumnText(self.currentItem, 2) |
|
163 |
connect_port = self.getColumnText(self.currentItem, 3) |
|
164 |
||
165 |
uri = self.CreateURI(connect_type, connect_address, connect_port) |
|
166 |
self.my_result=uri |
|
167 |
||
168 |
def GetResult(self): |
|
169 |
return self.my_result |
|
170 |
||
357
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
171 |
def removeService(self, zeroconf, type, name): |
375
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
172 |
''' |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
173 |
called when a service with the desired type goes offline. |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
174 |
''' |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
175 |
|
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
176 |
# loop through the list items looking for the service that went offline |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
177 |
for idx in xrange(self.list.GetItemCount()): |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
178 |
# this is the unique identifier assigned to the item |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
179 |
item_id = self.list.GetItemData(idx) |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
180 |
|
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
181 |
# this is the full typename that was received by addService |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
182 |
item_name = self.itemDataMap[item_id][4] |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
183 |
|
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
184 |
if item_name == name: |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
185 |
self.list.DeleteItem(idx) |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
186 |
break |
357
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
187 |
|
262 | 188 |
def addService(self, zeroconf, type, name): |
375
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
189 |
''' |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
190 |
called when a service with the desired type is discovered. |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
191 |
''' |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
192 |
|
357
19db1076e93c
close ZeroConf object when exiting the Service Discovery window.
btaylor@grond.willowglen.ab.ca
parents:
277
diff
changeset
|
193 |
info = self.zConfInstance.getServiceInfo(type, name) |
374
8787fa8c6792
bugfix: On Windows, sometimes the the wrong line in the service discovery list control is updated when multiple services are displayed and a new service is discovered.
b.taylor@willowglen.ca
parents:
357
diff
changeset
|
194 |
|
8787fa8c6792
bugfix: On Windows, sometimes the the wrong line in the service discovery list control is updated when multiple services are displayed and a new service is discovered.
b.taylor@willowglen.ca
parents:
357
diff
changeset
|
195 |
svcname = name.split(".")[0] |
203 | 196 |
typename = type.split(".")[0][1:] |
374
8787fa8c6792
bugfix: On Windows, sometimes the the wrong line in the service discovery list control is updated when multiple services are displayed and a new service is discovered.
b.taylor@willowglen.ca
parents:
357
diff
changeset
|
197 |
ip = str(socket.inet_ntoa(info.getAddress())) |
8787fa8c6792
bugfix: On Windows, sometimes the the wrong line in the service discovery list control is updated when multiple services are displayed and a new service is discovered.
b.taylor@willowglen.ca
parents:
357
diff
changeset
|
198 |
port = info.getPort() |
8787fa8c6792
bugfix: On Windows, sometimes the the wrong line in the service discovery list control is updated when multiple services are displayed and a new service is discovered.
b.taylor@willowglen.ca
parents:
357
diff
changeset
|
199 |
|
203 | 200 |
num_items = self.list.GetItemCount() |
375
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
201 |
|
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
202 |
# display the new data in the list |
374
8787fa8c6792
bugfix: On Windows, sometimes the the wrong line in the service discovery list control is updated when multiple services are displayed and a new service is discovered.
b.taylor@willowglen.ca
parents:
357
diff
changeset
|
203 |
new_item = self.list.InsertStringItem(num_items, svcname) |
8787fa8c6792
bugfix: On Windows, sometimes the the wrong line in the service discovery list control is updated when multiple services are displayed and a new service is discovered.
b.taylor@willowglen.ca
parents:
357
diff
changeset
|
204 |
self.list.SetStringItem(new_item, 1, "%s" % typename) |
8787fa8c6792
bugfix: On Windows, sometimes the the wrong line in the service discovery list control is updated when multiple services are displayed and a new service is discovered.
b.taylor@willowglen.ca
parents:
357
diff
changeset
|
205 |
self.list.SetStringItem(new_item, 2, "%s" % ip) |
375
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
206 |
self.list.SetStringItem(new_item, 3, "%s" % port) |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
207 |
|
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
208 |
# record the new data for the ColumnSorterMixin |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
209 |
# we assign every list item a unique id (that won't change when items |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
210 |
# are added or removed) |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
211 |
self.list.SetItemData(new_item, self.nextItemId) |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
212 |
|
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
213 |
# the value of each column has to be stored in the itemDataMap |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
214 |
# so that ColumnSorterMixin knows how to sort the column. |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
215 |
|
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
216 |
# "name" is included at the end so that self.removeService |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
217 |
# can access it. |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
218 |
self.itemDataMap[self.nextItemId] = [ svcname, typename, ip, port, name ] |
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
219 |
|
b16bcfe531d7
fix discovery dialog sorting, remove services from the discovery dialog when they go offline
b.taylor@willowglen.ca
parents:
374
diff
changeset
|
220 |
self.nextItemId += 1 |
203 | 221 |
|
222 |
def CreateURI(self, connect_type, connect_address, connect_port): |
|
223 |
uri = "%s://%s:%s"%(connect_type, connect_address, connect_port) |
|
224 |
return uri |
|
225 |
||
221 | 226 |
def ChooseLocalID(self, event): |
277
73890551f021
Local PYRO connection is designated by LOCAL://, not PYRO://localhost:3000 anymore
etisserant
parents:
262
diff
changeset
|
227 |
self.my_result = "LOCAL://" |
203 | 228 |
self.Close() |