Пример #1
0
def subparser_presentation_model(build_spec_subparser):
    app = wx.App(False)
    i18n.load(get_resource_path('languages'), 'english')
    model = MyModel(build_spec_subparser)
    view = MagicMock()
    presentation = Presenter(view, model)
    return presentation
Пример #2
0
def presentation_model(build_spec):
    app = wx.App(False)
    i18n.load(get_resource_path('languages'), build_spec['language'])
    model = MyModel(build_spec)
    view = MagicMock()
    presentation = Presenter(view, model)
    return presentation
Пример #3
0
def presentation_model(build_spec):
  app = wx.App(False)
  i18n.load(get_resource_path('languages'), build_spec['language'])
  model = MyModel(build_spec)
  view = MagicMock()
  presentation = Presenter(view, model)
  return presentation
Пример #4
0
def subparser_presentation_model(build_spec_subparser):
  app = wx.App(False)
  i18n.load(get_resource_path('languages'), 'english')
  model = MyModel(build_spec_subparser)
  view = MagicMock()
  presentation = Presenter(view, model)
  return presentation
Пример #5
0
def run(build_spec):
    app = wx.App(False)

    i18n.load(build_spec['language_dir'], build_spec['language'])
    image_repository.patch_images(build_spec['image_dir'])
    controller = Controller(build_spec)
    controller.run()
    app.MainLoop()
Пример #6
0
def run(build_spec):
  app = wx.App(False)

  i18n.load(build_spec['language'])

  frame = BaseWindow(build_spec)
  frame.Show(True)
  app.MainLoop()
Пример #7
0
def run(build_spec):
  app = wx.App(False)

  i18n.load(build_spec['language_dir'], build_spec['language'])
  image_repository.patch_images(build_spec['image_dir'])
  controller = Controller(build_spec)
  controller.run()
  app.MainLoop()
Пример #8
0
def run(build_spec):
    app = wx.App(False)

    i18n.load(build_spec['language'])

    frame = BaseWindow(build_spec)
    frame.Show(True)
    app.MainLoop()
Пример #9
0
def run(build_spec):
    app = wx.App(False)

    i18n.load(build_spec['language_dir'], build_spec['language'])
    image_repository.patch_images(build_spec['image_dir'])
    frame = BaseWindow(build_spec)
    frame.Show(True)
    app.MainLoop()
Пример #10
0
def run(build_spec):
  app = wx.App(False)

  i18n.load(build_spec['language_dir'], build_spec['language'])
  image_repository.patch_images(build_spec['image_dir'])
  frame = BaseWindow(build_spec)
  frame.Show(True)
  app.MainLoop()
def build_app(build_spec):
  app = wx.App(False)

  i18n.load(build_spec['language_dir'], build_spec['language'], build_spec['encoding'])
  imagesPaths = image_repository.loadImages(build_spec['image_dir'])
  gapp = GooeyApplication(merge(build_spec, imagesPaths))
  gapp.Show()
  return (app, gapp)
Пример #12
0
def build_app(build_spec):
  app = wx.App(False)

  i18n.load(build_spec['language_dir'], build_spec['language'], build_spec['encoding'])
  imagesPaths = image_repository.loadImages(build_spec['image_dir'])
  gapp = GooeyApplication(merge(build_spec, imagesPaths))
  # wx.lib.inspection.InspectionTool().Show()
  gapp.Show()
  return app
Пример #13
0
    def inner():
      main_module_path = get_caller_path()
      _, filename = os.path.split(main_module_path)
      cleaned_source = clean_source(main_module_path)

      filepath = os.path.join(TMP_DIR, filename)
      with open(filepath, 'w') as f:
        f.write(cleaned_source)

      run_cmd = 'python {}'.format(filepath)

      # Must be called before anything else
      app = wx.App(False)

      i18n.load(language)

      # load gui components after loading the language pack
      from gooey.gui.client_app import ClientApp
      from gooey.gui.client_app import EmptyClientApp
      from gooey.gui.windows.base_window import BaseWindow
      from gooey.gui.windows.advanced_config import AdvancedConfigPanel
      from gooey.gui.windows.basic_config_panel import BasicConfigPanel

      if show_config:
        parser = get_parser(main_module_path)

        meta = {
          'target': run_cmd,
          'program_name': program_name,
          'program_description': program_description or parser.description,
          'show_config': show_config,
          'show_advanced': advanced,
          'default_size': (610, 530),
          'requireds_cols': 1,
          'optionals_cols': 2
        }
        client_app = ClientApp(parser, payload)

        build_spec = dict(meta.items() + argparse_to_json.convert(parser).items())

        if advanced:
          BodyPanel = partial(AdvancedConfigPanel, build_spec=build_spec)
        else:
          BodyPanel = BasicConfigPanel
      # User doesn't want to display configuration screen
      # Just jump straight to the run panel
      else:
        BodyPanel = BasicConfigPanel
        client_app = EmptyClientApp(payload)

      frame = BaseWindow(BodyPanel, build_spec, params)

      if not show_config:
        frame.ManualStart()
      frame.Show(True)
      app.MainLoop()
Пример #14
0
def run(build_spec):
    app = wx.App(False)

    i18n.load(build_spec['language'])

    BodyPanel = partial(AdvancedConfigPanel, build_spec=build_spec)

    frame = BaseWindow(BodyPanel, build_spec)

    frame.Show(True)
    app.MainLoop()
Пример #15
0
def run(build_spec):
  app = wx.App(False)

  i18n.load(build_spec['language'])

  BodyPanel = partial(AdvancedConfigPanel, build_spec=build_spec)

  frame = BaseWindow(BodyPanel, build_spec)

  frame.Show(True)
  app.MainLoop()
Пример #16
0
def _build_app(build_spec, app):
    """
    Note: this method is broken out with app as
    an argument to facilitate testing.
    """
    # use actual program name instead of script file name in macOS menu
    app.SetAppDisplayName(build_spec['program_name'])

    i18n.load(build_spec['language_dir'], build_spec['language'],
              build_spec['encoding'])
    imagesPaths = image_repository.loadImages(build_spec['image_dir'])
    gapp = GooeyApplication(merge(build_spec, imagesPaths))
    # wx.lib.inspection.InspectionTool().Show()
    gapp.Show()
    return (app, gapp)
Пример #17
0
def _build_app(build_spec, app) -> Tuple[Any, wx.Frame]:
    """
    Note: this method is broken out with app as
    an argument to facilitate testing.
    """
    # use actual program name instead of script file name in macOS menu
    app.SetAppDisplayName(build_spec['program_name'])

    i18n.load(build_spec['language_dir'], build_spec['language'],
              build_spec['encoding'])
    imagesPaths = image_repository.loadImages(build_spec['image_dir'])
    gapp2 = render(create_element(RGooey, merge(build_spec, imagesPaths)),
                   None)
    # wx.lib.inspection.InspectionTool().Show()
    # gapp.Show()
    gapp2.Show()
    return (app, gapp2)
Пример #18
0
        def inner():
            show_config = params[
                'show_config']  #because nonlocal keyword doesn't exist yet :(

            main_module_path = get_caller_path()
            _, filename = os.path.split(main_module_path)
            cleaned_source = clean_source(main_module_path)

            descriptor, tmp_filepath = tempfile.mkstemp(suffix='.py')
            atexit.register(cleanup, descriptor, tmp_filepath)

            with open(tmp_filepath, 'w') as f:
                f.write(cleaned_source)

            if not has_argparse(cleaned_source):
                show_config = False

            run_cmd = 'python {}'.format(tmp_filepath)

            # Must be called before anything else
            app = wx.App(False)

            i18n.load(language)

            # load gui components after loading the language pack
            from gooey.gui.client_app import ClientApp
            from gooey.gui.client_app import EmptyClientApp
            from gooey.gui.windows.base_window import BaseWindow
            from gooey.gui.windows.advanced_config import AdvancedConfigPanel
            from gooey.gui.windows.basic_config_panel import BasicConfigPanel

            meta = {
                'target': run_cmd,
                'program_name': program_name,
                'program_description': program_description or '',
                'show_config': show_config,
                'show_advanced': advanced,
                'default_size': (610, 530),
                'requireds_cols': 1,
                'optionals_cols': 2,
                'manual_start': False
            }

            if show_config:
                parser = get_parser(main_module_path)
                meta[
                    'program_description'] = parser.description or program_description

                client_app = ClientApp(parser, payload)

                if advanced:
                    build_spec = dict(meta.items() +
                                      argparse_to_json.convert(parser).items())
                    BodyPanel = partial(AdvancedConfigPanel,
                                        build_spec=build_spec)
                else:
                    build_spec = dict(meta.items() +
                                      layouts.basic_config.items())
                    BodyPanel = partial(AdvancedConfigPanel,
                                        build_spec=build_spec)
            # User doesn't want to display configuration screen
            # Just jump straight to the run panel
            else:
                build_spec = dict(meta.items() + layouts.basic_config.items())
                build_spec['manual_start'] = True
                BodyPanel = partial(AdvancedConfigPanel, build_spec=build_spec)
                client_app = EmptyClientApp(payload)

            frame = BaseWindow(BodyPanel, build_spec, params)

            if not show_config:
                frame.ManualStart()
            frame.Show(True)
            app.MainLoop()
Пример #19
0
    def inner():
      show_config = params['show_config'] #because nonlocal keyword doesn't exist yet :(

      main_module_path = get_caller_path()
      _, filename = os.path.split(main_module_path)
      cleaned_source = clean_source(main_module_path)

      descriptor, tmp_filepath = tempfile.mkstemp(suffix='.py')
      atexit.register(cleanup, descriptor, tmp_filepath)

      with open(tmp_filepath, 'w') as f:
        f.write(cleaned_source)

      if not has_argparse(cleaned_source):
        show_config = False

      run_cmd = 'python {}'.format(tmp_filepath)

      # Must be called before anything else
      app = wx.App(False)

      i18n.load(language)

      # load gui components after loading the language pack
      from gooey.gui.client_app import ClientApp
      from gooey.gui.client_app import EmptyClientApp
      from gooey.gui.windows.base_window import BaseWindow
      from gooey.gui.windows.advanced_config import AdvancedConfigPanel
      from gooey.gui.windows.basic_config_panel import BasicConfigPanel

      meta = {
        'target': run_cmd,
        'program_name': program_name,
        'program_description': program_description or '',
        'show_config': show_config,
        'show_advanced': advanced,
        'default_size': (610, 530),
        'requireds_cols': 1,
        'optionals_cols': 2,
        'manual_start': False
      }

      if show_config:
        parser = get_parser(main_module_path)
        meta['program_description'] = parser.description or program_description

        client_app = ClientApp(parser, payload)

        if advanced:
          build_spec = dict(meta.items() + argparse_to_json.convert(parser).items())
          BodyPanel = partial(AdvancedConfigPanel, build_spec=build_spec)
        else:
          build_spec = dict(meta.items() + layouts.basic_config.items())
          BodyPanel = partial(AdvancedConfigPanel, build_spec=build_spec)
      # User doesn't want to display configuration screen
      # Just jump straight to the run panel
      else:
        build_spec = dict(meta.items() + layouts.basic_config.items())
        build_spec['manual_start'] = True
        BodyPanel = partial(AdvancedConfigPanel, build_spec=build_spec)
        client_app = EmptyClientApp(payload)


      frame = BaseWindow(BodyPanel, build_spec, params)

      if not show_config:
        frame.ManualStart()
      frame.Show(True)
      app.MainLoop()