Beremiz_service.py
changeset 1747 6046ffa2280f
parent 1746 45d6f5fba016
child 1749 d73b64672238
equal deleted inserted replaced
1746:45d6f5fba016 1747:6046ffa2280f
   308             def OnTaskBarChangeInterface(self, evt):
   308             def OnTaskBarChangeInterface(self, evt):
   309                 ip_addr = self.pyroserver.ip_addr
   309                 ip_addr = self.pyroserver.ip_addr
   310                 ip_addr = '' if ip_addr is None else ip_addr
   310                 ip_addr = '' if ip_addr is None else ip_addr
   311                 dlg = ParamsEntryDialog(None, _("Enter the IP of the interface to bind"), defaultValue=ip_addr)
   311                 dlg = ParamsEntryDialog(None, _("Enter the IP of the interface to bind"), defaultValue=ip_addr)
   312                 dlg.SetTests([(re.compile('\d{1,3}(?:\.\d{1,3}){3}$').match, _("IP is not valid!")),
   312                 dlg.SetTests([(re.compile('\d{1,3}(?:\.\d{1,3}){3}$').match, _("IP is not valid!")),
   313                                ( lambda x:len([x for x in x.split(".") if 0 <= int(x) <= 255]) == 4, _("IP is not valid!"))
   313                                (lambda x:len([x for x in x.split(".") if 0 <= int(x) <= 255]) == 4, _("IP is not valid!"))
   314                                ])
   314                                ])
   315                 if dlg.ShowModal() == wx.ID_OK:
   315                 if dlg.ShowModal() == wx.ID_OK:
   316                     self.pyroserver.ip_addr = dlg.GetValue()
   316                     self.pyroserver.ip_addr = dlg.GetValue()
   317                     self.pyroserver.Stop()
   317                     self.pyroserver.Stop()
   318 
   318