make mki18n.py wx-3.0 compatible and fix segmentation fault
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Mon, 18 Apr 2016 19:17:22 +0300
changeset 1482 5d4543ee5a5d
parent 1481 5b294dcaae18
child 1483 004f9c52f7d8
make mki18n.py wx-3.0 compatible and fix segmentation fault

$ python mki18n.py -m -v --moTarget=../locale --domain=Beremiz
No project directory given. Using current one: /home/beremiz/beremiz/i18n
Application domain used is: 'Beremiz'
Target directory for .mo files is: ../locale
../src/common/stdpbase.cpp(62): assert "traits" failed in Get(): create wxApp before calling this
Segmentation fault
i18n/mki18n.py
--- a/i18n/mki18n.py	Mon Apr 18 19:15:55 2016 +0300
+++ b/i18n/mki18n.py	Mon Apr 18 19:17:22 2016 +0300
@@ -95,7 +95,12 @@
 
 def getlanguageDict():
     languageDict = {}
-    
+
+    if wx.VERSION >= (3, 0, 0):
+        app = wx.App()
+    else:
+        app = wx.PySimpleApp()
+
     for lang in [x for x in dir(wx) if x.startswith("LANGUAGE")]:
         i = wx.Locale(wx.LANGUAGE_DEFAULT).GetLanguageInfo(getattr(wx, lang))
         if i: