diff -r 31e63e25b4cc -r 64beb9e9c749 dialogs/PouNameDialog.py --- a/dialogs/PouNameDialog.py Mon Aug 21 20:17:19 2017 +0000 +++ b/dialogs/PouNameDialog.py Mon Aug 21 23:22:58 2017 +0300 @@ -24,21 +24,22 @@ import wx -#------------------------------------------------------------------------------- +# ------------------------------------------------------------------------------- # POU Name Dialog -#------------------------------------------------------------------------------- +# ------------------------------------------------------------------------------- + class PouNameDialog(wx.TextEntryDialog): - def __init__(self, parent, message, caption = "Please enter text", defaultValue = "", - style = wx.OK|wx.CANCEL|wx.CENTRE, pos = wx.DefaultPosition): + def __init__(self, parent, message, caption="Please enter text", defaultValue="", + style=wx.OK | wx.CANCEL | wx.CENTRE, pos=wx.DefaultPosition): wx.TextEntryDialog.__init__(self, parent, message, caption, defaultValue, style, pos) - + self.PouNames = [] - - self.Bind(wx.EVT_BUTTON, self.OnOK, - self.GetSizer().GetItem(2).GetSizer().GetItem(1).GetSizer().GetAffirmativeButton()) - + + self.Bind(wx.EVT_BUTTON, self.OnOK, + self.GetSizer().GetItem(2).GetSizer().GetItem(1).GetSizer().GetAffirmativeButton()) + def OnOK(self, event): message = None step_name = self.GetSizer().GetItem(1).GetWindow().GetValue() @@ -51,7 +52,7 @@ elif step_name.upper() in self.PouNames: message = _("A POU named \"%s\" already exists!") % step_name if message is not None: - dialog = wx.MessageDialog(self, message, _("Error"), wx.OK|wx.ICON_ERROR) + dialog = wx.MessageDialog(self, message, _("Error"), wx.OK | wx.ICON_ERROR) dialog.ShowModal() dialog.Destroy() else: @@ -60,4 +61,3 @@ def SetPouNames(self, pou_names): self.PouNames = [pou_name.upper() for pou_name in pou_names] -