34 from types import ListType |
34 from types import ListType |
35 |
35 |
36 beremiz_dir = os.path.dirname(os.path.realpath(__file__)) |
36 beremiz_dir = os.path.dirname(os.path.realpath(__file__)) |
37 |
37 |
38 import wxversion |
38 import wxversion |
39 wxversion.select('2.8') |
39 wxversion.select(['2.8', '3.0']) |
40 import wx |
40 import wx |
41 from wx.lib.agw.advancedsplash import AdvancedSplash |
41 from wx.lib.agw.advancedsplash import AdvancedSplash |
42 |
42 |
43 def Bpath(*args): |
43 def Bpath(*args): |
44 return os.path.join(beremiz_dir,*args) |
44 return os.path.join(beremiz_dir,*args) |
82 if os.path.exists("BEREMIZ_DEBUG"): |
82 if os.path.exists("BEREMIZ_DEBUG"): |
83 __builtin__.__dict__["BMZ_DBG"] = True |
83 __builtin__.__dict__["BMZ_DBG"] = True |
84 else : |
84 else : |
85 __builtin__.__dict__["BMZ_DBG"] = False |
85 __builtin__.__dict__["BMZ_DBG"] = False |
86 |
86 |
87 app = wx.PySimpleApp(redirect=BMZ_DBG) |
87 if wx.VERSION >= (3, 0, 0): |
|
88 app = wx.App(redirect=BMZ_DBG) |
|
89 else: |
|
90 app = wx.PySimpleApp(redirect=BMZ_DBG) |
|
91 |
88 app.SetAppName('beremiz') |
92 app.SetAppName('beremiz') |
89 wx.InitAllImageHandlers() |
93 if wx.VERSION < (3, 0, 0): |
|
94 wx.InitAllImageHandlers() |
90 |
95 |
91 # popup splash |
96 # popup splash |
92 bmp = wx.Image(Bpath("images", "splash.png")).ConvertToBitmap() |
97 bmp = wx.Image(Bpath("images", "splash.png")).ConvertToBitmap() |
93 #splash=AdvancedSplash(None, bitmap=bmp, style=wx.SPLASH_CENTRE_ON_SCREEN, timeout=4000) |
98 #splash=AdvancedSplash(None, bitmap=bmp, style=wx.SPLASH_CENTRE_ON_SCREEN, timeout=4000) |
94 splash=AdvancedSplash(None, bitmap=bmp) |
99 splash=AdvancedSplash(None, bitmap=bmp) |