--- a/wxglade_hmi/wxglade_hmi.py Fri Jun 02 19:58:27 2017 +0300
+++ b/wxglade_hmi/wxglade_hmi.py Tue Jun 06 13:05:30 2017 +0300
@@ -51,9 +51,24 @@
# define name for wxGlade gui file
return os.path.join(project_path, "hmi.wxg")
+
+ def GetWxGladePath(self):
+ path = None
+ try:
+ from wxglade import __file__ as fileName
+ path = os.path.dirname(fileName)
+ return path
+ except ImportError:
+ pass
+
+ defLibDir="/usr/share/wxglade"
+ if os.path.isdir(defLibDir):
+ path = defLibDir
+
+ return path
+
def launch_wxglade(self, options, wait=False):
- from wxglade import __file__ as fileName
- path = os.path.dirname(fileName)
+ path = self.GetWxGladePath()
glade = os.path.join(path, 'wxglade.py')
if wx.Platform == '__WXMSW__':
glade = "\"%s\""%glade