Beremiz_service.py
changeset 1451 94e620cbd9de
parent 1447 d6b878525ceb
child 1453 f31353cac197
equal deleted inserted replaced
1450:44bf0ba866e9 1451:94e620cbd9de
    94         extensions.append(a)
    94         extensions.append(a)
    95     else:
    95     else:
    96         usage()
    96         usage()
    97         sys.exit()
    97         sys.exit()
    98 
    98 
    99 CWD = os.path.split(os.path.realpath(__file__))[0]
    99 beremiz_dir = os.path.dirname(os.path.realpath(__file__))
   100 
   100 
   101 if len(argv) > 1:
   101 if len(argv) > 1:
   102     usage()
   102     usage()
   103     sys.exit()
   103     sys.exit()
   104 elif len(argv) == 1:
   104 elif len(argv) == 1:
   112 if __name__ == '__main__':
   112 if __name__ == '__main__':
   113     __builtin__.__dict__['_'] = lambda x: x
   113     __builtin__.__dict__['_'] = lambda x: x
   114 
   114 
   115 if enablewx:
   115 if enablewx:
   116     try:
   116     try:
   117         import wx, re
   117         import wxversion
   118         from threading import Thread, currentThread
   118         wxversion.select('2.8')
   119         from types import *
   119         import wx
   120         havewx = True
   120         havewx = True
   121     except:
   121     except:
   122         print "Wx unavailable !"
   122         print "Wx unavailable !"
   123         havewx = False
   123         havewx = False
   124 
   124 
   125     if havewx:
   125     if havewx:
       
   126         import re
       
   127         from threading import Thread, currentThread
       
   128         from types import *
   126         app=wx.App(redirect=False)
   129         app=wx.App(redirect=False)
   127 
   130 
   128         # Import module for internationalization
   131         # Import module for internationalization
   129         import gettext
   132         import gettext
   130 
   133 
   131         def Bpath(*args):
   134         def Bpath(*args):
   132             return os.path.join(CWD,*args)
   135             return os.path.join(beremiz_dir,*args)
   133 
   136 
   134         # Get folder containing translation files
   137         # Get folder containing translation files
   135         localedir = os.path.join(CWD,"locale")
   138         localedir = os.path.join(beremiz_dir,"locale")
   136         # Get the default language
   139         # Get the default language
   137         langid = wx.LANGUAGE_DEFAULT
   140         langid = wx.LANGUAGE_DEFAULT
   138         # Define translation domain (name of translation files)
   141         # Define translation domain (name of translation files)
   139         domain = "Beremiz"
   142         domain = "Beremiz"
   140 
   143