Giter Club home page Giter Club logo

Comments (10)

chriskiehl avatar chriskiehl commented on June 29, 2024

Your code looks just like this?

import argparse
from gooey import Gooey

@Gooey
def main():
  parser = argparse.ArgumentParser(description='Process some integers.')
  parser.add_argument('integers', metavar='N', type=int, nargs='+',
                     help='an integer for the accumulator')
  parser.add_argument('--sum', dest='accumulate', action='store_const',
                     const=sum, default=max,
                     help='sum the integers (default: find the max)')

  args = parser.parse_args()
  print args.accumulate(args.integers)


if __name__ == '__main__':
  main()

If so, I'm not quite sure what's wrong. I've never tested Gooey on a linux box. Are you able to run any of the examples in the mockapplications directory?

from gooey.

Djiit avatar Djiit commented on June 29, 2024

Hi,

Yep I'm able to run the mockapp.py example (same venv, same interpreter).

from gooey.

Djiit avatar Djiit commented on June 29, 2024

Ok so I was able to run the argparse example without the nargs='+' argument.
Values '?', '+' throw the error above whereas values like 1, 2, N are ok.

This snippet works :

import argparse
from gooey import Gooey

@Gooey
def main():
  parser = argparse.ArgumentParser(description='Process some integers.')
  parser.add_argument('integers', metavar='N', type=int, nargs=2,
                     help='an integer for the accumulator')
  parser.add_argument('--sum', dest='accumulate', action='store_const',
                     const=sum, default=max,
                     help='sum the integers (default: find the max)')

  args = parser.parse_args()
  print args.accumulate(args.integers)


if __name__ == '__main__':
  main()

It may be something related to the 'nargs' support ?

Hope this helps,

Thx

from gooey.

chriskiehl avatar chriskiehl commented on June 29, 2024

Helpful, indeed! I must have missed the ? and + operators.

I'll take a look at it tonight.

from gooey.

kwilkers avatar kwilkers commented on June 29, 2024

Same problem here as well, it seems nargs with ? or + operators brings forward the same errors as Djiit.

from gooey.

chriskiehl avatar chriskiehl commented on June 29, 2024

@Djiit

@kwilkers

I made a couple of changes. Can you guys do a fresh pull and let me know if you're still experiencing the same issue?

Thanks!

from gooey.

kwilkers avatar kwilkers commented on June 29, 2024

@chriskiehl

Fresh pulled and ran fine on Windows, tried my Linux (Ubuntu 12.04.3) and received the same error as before (below). Tried playing around for a bit, but haven't found where the bug is. I'll play around with the code later on tonight and see if I can't come up with anything.

  Traceback (most recent call last):
  File "mock_argparse_example.py", line 19, in <module>
      main()
  File "/home/kriss/.local/lib/python2.7/site-packages/Gooey-0.1.0-py2.7.egg/gooey/gooey_decorator.py", line 97, in inner
      frame = BaseWindow(BodyPanel, client_app, params)
  File "/home/kriss/.local/lib/python2.7/site-packages/Gooey-0.1.0-py2.7.egg/gooey/gui/base_window.py", line 44, in __init__
      self._init_components(BodyPanel)
  File "/home/kriss/.local/lib/python2.7/site-packages/Gooey-0.1.0-py2.7.egg/gooey/gui/base_window.py", line 68, in _init_components
self.config_panel = BodyPanel(self)
    File "/home/kriss/.local/lib/python2.7/site-packages/Gooey-0.1.0-py2.7.egg/gooey/gui/advanced_config.py", line 38, in __init__
self._do_layout()
    File "/home/kriss/.local/lib/python2.7/site-packages/Gooey-0.1.0-py2.7.egg/gooey/gui/advanced_config.py", line 59, in _do_layout
self.AddWidgets(container, self.components.required_args, add_space=True)
    File "/home/kriss/.local/lib/python2.7/site-packages/Gooey-0.1.0-py2.7.egg/gooey/gui/advanced_config.py", line 79, in AddWidgets
widget_group = component.Build(parent=self)
    File "/home/kriss/.local/lib/python2.7/site-packages/Gooey-0.1.0-py2.7.egg/gooey/gui/components.py", line 38, in Build
self._msg = self.CreateHelpMsgWidget(parent, self._action)
    File "/home/kriss/.local/lib/python2.7/site-packages/Gooey-0.1.0-py2.7.egg/gooey/gui/components.py", line 67, in CreateHelpMsgWidget
base_text.SetLabelText(base_text.GetLabelText() + self.CreateNargsMsg(action))
  AttributeError: 'StaticText' object has no attribute 'SetLabelText'

from gooey.

chriskiehl avatar chriskiehl commented on June 29, 2024

Hmm.. Weird. I'll have to install Ubuntu and do some exploring.

from gooey.

LudoVio avatar LudoVio commented on June 29, 2024

same on linux mint, if it s different on windows and linux it should be a bug in wx

from gooey.

chriskiehl avatar chriskiehl commented on June 29, 2024

Couple of quirks have been smoothed out on the Linux side or things. I'm can successfully run Gooey under Ubuntu without issue. Do you want to pull a fresh copy and try it on your Mint system?

from gooey.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.