You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
926 B

  1. '''
  2. Main runner entry point for Gooey.
  3. '''
  4. import wx
  5. # wx.html and wx.xml imports required here to make packaging with
  6. # pyinstaller on OSX possible without manually specifying `hidden_imports`
  7. # in the build.spec
  8. import wx.html
  9. import wx.xml
  10. import wx.richtext # Need to be imported before the wx.App object is created.
  11. import wx.lib.inspection
  12. from gooey.gui.lang import i18n
  13. from gooey.gui import image_repository
  14. from gooey.gui.containers.application import GooeyApplication
  15. from gooey.util.functional import merge
  16. def run(build_spec):
  17. app = build_app(build_spec)
  18. app.MainLoop()
  19. def build_app(build_spec):
  20. app = wx.App(False)
  21. i18n.load(build_spec['language_dir'], build_spec['language'], build_spec['encoding'])
  22. imagesPaths = image_repository.loadImages(build_spec['image_dir'])
  23. gapp = GooeyApplication(merge(build_spec, imagesPaths))
  24. gapp.Show()
  25. return app