Fixed bug in wxGlade extension when compiling and starting project with no hmi defined
--- a/wxglade_hmi/wxglade_hmi.py Thu Jun 13 09:37:43 2013 +0200
+++ b/wxglade_hmi/wxglade_hmi.py Thu Jun 13 09:42:59 2013 +0200
@@ -71,12 +71,16 @@
define_hmi = hmipyfile.read().decode('utf-8')
hmipyfile.close()
+ else:
+ define_hmi = ""
+
declare_hmi = "\n".join(["%(name)s = None\n" % x +
"\n".join(["%(class)s.%(h)s = %(h)s"%
dict(x,h=h) for h in x['handlers']])
for x in hmi_frames])
- global_hmi = "global %s\n"%",".join(
- [x["name"] for x in hmi_frames])
+ global_hmi = ("global %s\n"%",".join(
+ [x["name"] for x in hmi_frames])
+ if len(hmi_frames) > 0 else "")
init_hmi = "\n".join(["""\
def OnCloseFrame(evt):
wx.MessageBox(_("Please stop PLC to close"))