diff -r 44bf0ba866e9 -r 94e620cbd9de Beremiz_service.py --- a/Beremiz_service.py Tue Feb 24 11:50:54 2015 +0100 +++ b/Beremiz_service.py Wed Feb 25 13:59:01 2015 +0100 @@ -96,7 +96,7 @@ usage() sys.exit() -CWD = os.path.split(os.path.realpath(__file__))[0] +beremiz_dir = os.path.dirname(os.path.realpath(__file__)) if len(argv) > 1: usage() @@ -114,25 +114,28 @@ if enablewx: try: - import wx, re - from threading import Thread, currentThread - from types import * + import wxversion + wxversion.select('2.8') + import wx havewx = True except: print "Wx unavailable !" havewx = False if havewx: + import re + from threading import Thread, currentThread + from types import * app=wx.App(redirect=False) # Import module for internationalization import gettext def Bpath(*args): - return os.path.join(CWD,*args) + return os.path.join(beremiz_dir,*args) # Get folder containing translation files - localedir = os.path.join(CWD,"locale") + localedir = os.path.join(beremiz_dir,"locale") # Get the default language langid = wx.LANGUAGE_DEFAULT # Define translation domain (name of translation files)