--- a/connectors/PYRO/__init__.py Fri Dec 21 13:51:33 2018 +0100
+++ b/connectors/PYRO/__init__.py Mon Jan 07 11:33:34 2019 +0100
@@ -39,7 +39,6 @@
import PSKManagement as PSK
from runtime import PlcStatus
-zeroconf_service_type = '_PYRO._tcp.local.'
# this module attribute contains a list of DNS-SD (Zeroconf) service types
# supported by this connector confnode.
@@ -71,24 +70,6 @@
- if location.find(zeroconf_service_type) != -1:
- from zeroconf import Zeroconf
- i = r.get_service_info(zeroconf_service_type, location)
- raise Exception("'%s' not found" % location)
- ip = str(socket.inet_ntoa(i.address))
- newlocation = ip + ':' + port
- confnodesroot.logger.write(_("'{a1}' is located at {a2}\n").format(a1=location, a2=newlocation))
- confnodesroot.logger.write_error(_("MDNS resolution failure for '%s'\n") % location)
- confnodesroot.logger.write_error(traceback.format_exc())
# Try to get the proxy object
RemotePLCObjectProxy = Pyro.core.getAttrProxyForURI(schemename + "://" + location + "/PLCObject")
--- a/connectors/__init__.py Fri Dec 21 13:51:33 2018 +0100
+++ b/connectors/__init__.py Mon Jan 07 11:33:34 2019 +0100
@@ -67,6 +67,11 @@
or None if cannot connect to URI
_scheme = uri.split("://")[0].upper()
+ # commented code to enable for MDNS:// support + # _scheme, location = uri.split("://") + # _scheme = _scheme.upper() # pyro connection to local runtime
@@ -75,6 +80,28 @@
runtime_port = confnodesroot.AppFrame.StartLocalRuntime(
uri = "PYROLOC://127.0.0.1:" + str(runtime_port)
+ # commented code to enable for MDNS:// support + # elif _scheme == "MDNS": + # from zeroconf import Zeroconf + # i = r.get_service_info(zeroconf_service_type, location) + # raise Exception("'%s' not found" % location) + # ip = str(socket.inet_ntoa(i.address)) + # newlocation = ip + ':' + port + # confnodesroot.logger.write(_("'{a1}' is located at {a2}\n").format(a1=location, a2=newlocation)) + # location = newlocation + # # not a bug, but a workaround against obvious downgrade attack + # confnodesroot.logger.write_error(_("MDNS resolution failure for '%s'\n") % location) + # confnodesroot.logger.write_error(traceback.format_exc()) elif _scheme in connectors:
elif _scheme[-1] == 'S' and _scheme[:-1] in connectors:
--- a/controls/DiscoveryPanel.py Fri Dec 21 13:51:33 2018 +0100
+++ b/controls/DiscoveryPanel.py Mon Jan 07 11:33:34 2019 +0100
@@ -54,7 +54,7 @@
def _init_coll_ButtonGridSizer_Items(self, parent):
parent.AddWindow(self.RefreshButton, 0, border=0, flag=0)
- parent.AddWindow(self.ByIPCheck, 0, border=0, flag=0)
+ # parent.AddWindow(self.ByIPCheck, 0, border=0, flag=0) def _init_coll_ButtonGridSizer_Growables(self, parent):
@@ -100,8 +100,8 @@
pos=wx.Point(0, 0), size=wx.DefaultSize, style=0)
self.RefreshButton.Bind(wx.EVT_BUTTON, self.OnRefreshButton)
- self.ByIPCheck = wx.CheckBox(self, label=_("Use IP instead of Service Name"))
- self.ByIPCheck.SetValue(True)
+ # self.ByIPCheck = wx.CheckBox(self, label=_("Use IP instead of Service Name")) + # self.ByIPCheck.SetValue(True) @@ -190,17 +190,17 @@
if self.LatestSelection is not None:
- if self.ByIPCheck.IsChecked():
- svcname, scheme, host, port = \
- map(lambda col:self.getColumnText(self.LatestSelection, col),
- return ("%s://%s:%s#%s" % (scheme, host, port, svcname)) \
- else ("%s://%s:%s" % (scheme, host, port))
- svcname = self.getColumnText(self.LatestSelection, 0)
- connect_type = self.getColumnText(self.LatestSelection, 1)
- return str("MDNS://%s" % svcname)
+ # if self.ByIPCheck.IsChecked(): + svcname, scheme, host, port = \ + map(lambda col:self.getColumnText(self.LatestSelection, col), + return ("%s://%s:%s#%s" % (scheme, host, port, svcname)) \ + else ("%s://%s:%s" % (scheme, host, port)) + # svcname = self.getColumnText(self.LatestSelection, 0) + # connect_type = self.getColumnText(self.LatestSelection, 1) + # return str("MDNS://%s" % svcname) def remove_service(self, zeroconf, _type, name):