lpcmanager

Added import for wx 3.0.

2017-01-26, dporopat
20125804dfa5
Parents f8f43d6ab8b5
Children 3feb90a23f5f
Added import for wx 3.0.
  • +10 -6
    LPCManager.py
  • --- a/LPCManager.py Thu Jan 26 12:30:52 2017 +0100
    +++ b/LPCManager.py Thu Jan 26 12:31:35 2017 +0100
    @@ -16,10 +16,10 @@
    _beremiz_folder = os.path.join(_dist_folder, "beremiz")
    sys.path.append(_beremiz_folder)
    -import wxversion
    -
    -wxversion.select('2.8')
    -import wx
    +if __name__ == '__main__':
    + import wxversion
    + wxversion.select(['2.8', '3.0'])
    + import wx
    def Bpath(*args):
    @@ -63,9 +63,13 @@
    PLC_module = {'MC9', 'GOT'}
    __builtin__.__dict__["BMZ_DBG"] = os.path.exists("LPC_DEBUG")
    - app = wx.PySimpleApp(redirect=BMZ_DBG)
    + if wx.VERSION >= (3, 0, 0):
    + app = wx.App(redirect=BMZ_DBG)
    + else:
    + app = wx.PySimpleApp(redirect=BMZ_DBG)
    app.SetAppName('beremiz')
    - wx.InitAllImageHandlers()
    + if wx.VERSION < (3, 0, 0):
    + wx.InitAllImageHandlers()
    from util.misc import InstallLocalRessources