Beremiz_service.py
changeset 2319 0a951f528c69
parent 2315 523559fe6352
child 2321 0a3103cd825d
equal deleted inserted replaced
2318:8925d487605a 2319:0a951f528c69
   140     os.chdir(WorkingDir)
   140     os.chdir(WorkingDir)
   141 elif len(argv) == 0:
   141 elif len(argv) == 0:
   142     WorkingDir = os.getcwd()
   142     WorkingDir = os.getcwd()
   143     argv = [WorkingDir]
   143     argv = [WorkingDir]
   144 
   144 
   145 if __name__ == '__main__':
   145 __builtin__.__dict__['_'] = lambda x: x
   146     __builtin__.__dict__['_'] = lambda x: x
   146 # TODO: add a cmdline parameter if Trying Preloading Xenomai makes problem
   147     # TODO: add a cmdline parameter if Trying Preloading Xenomai makes problem
   147 TryPreloadXenomai()
   148     TryPreloadXenomai()
   148 version()
   149     version()
       
   150 
   149 
   151 
   150 
   152 def Bpath(*args):
   151 def Bpath(*args):
   153     return os.path.join(beremiz_dir, *args)
   152     return os.path.join(beremiz_dir, *args)
   154 
   153 
   181     # And unicode string returned by wx.GetTranslation() are
   180     # And unicode string returned by wx.GetTranslation() are
   182     # automatically converted to 'ascii' string.
   181     # automatically converted to 'ascii' string.
   183     def unicode_translation(message):
   182     def unicode_translation(message):
   184         return wx.GetTranslation(message).encode(default_locale)
   183         return wx.GetTranslation(message).encode(default_locale)
   185 
   184 
   186     if __name__ == '__main__':
   185     __builtin__.__dict__['_'] = unicode_translation
   187         __builtin__.__dict__['_'] = unicode_translation
   186     # __builtin__.__dict__['_'] = wx.GetTranslation
   188         # __builtin__.__dict__['_'] = wx.GetTranslation
       
   189 
   187 
   190 
   188 
   191 # Life is hard... have a candy.
   189 # Life is hard... have a candy.
   192 # pylint: disable=wrong-import-position,wrong-import-order
   190 # pylint: disable=wrong-import-position,wrong-import-order
   193 if enablewx:
   191 if enablewx: