Beremiz_service.py
changeset 1730 64d8f52bc8c8
parent 1680 6db967480b7d
child 1732 94ffe74e6895
equal deleted inserted replaced
1726:d51af006fa6b 1730:64d8f52bc8c8
   304                         print _("PLC is not started.")
   304                         print _("PLC is not started.")
   305 
   305 
   306             def OnTaskBarChangeInterface(self, evt):
   306             def OnTaskBarChangeInterface(self, evt):
   307                 ip_addr = self.pyroserver.ip_addr
   307                 ip_addr = self.pyroserver.ip_addr
   308                 ip_addr = '' if ip_addr is None else ip_addr
   308                 ip_addr = '' if ip_addr is None else ip_addr
   309                 dlg = ParamsEntryDialog(None, _("Enter the IP of the interface to bind"), defaultValue=ip_addr)                
   309                 dlg = ParamsEntryDialog(None, _("Enter the IP of the interface to bind"), defaultValue=ip_addr)
   310                 dlg.SetTests([(re.compile('\d{1,3}(?:\.\d{1,3}){3}$').match, _("IP is not valid!")),
   310                 dlg.SetTests([(re.compile('\d{1,3}(?:\.\d{1,3}){3}$').match, _("IP is not valid!")),
   311                                ( lambda x :len([x for x in x.split(".") if 0 <= int(x) <= 255]) == 4, _("IP is not valid!"))
   311                                ( lambda x :len([x for x in x.split(".") if 0 <= int(x) <= 255]) == 4, _("IP is not valid!"))
   312                                ])
   312                                ])
   313                 if dlg.ShowModal() == wx.ID_OK:
   313                 if dlg.ShowModal() == wx.ID_OK:
   314                     self.pyroserver.ip_addr = dlg.GetValue()
   314                     self.pyroserver.ip_addr = dlg.GetValue()