Code Monkey home page Code Monkey logo

gooeyexamples's People

Contributors

besslwalker avatar bje- avatar chriskiehl avatar edjw avatar elad-eyal avatar jackmckew avatar nelsonjchen avatar shamrin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gooeyexamples's Issues

Some GUI elements are hard to see

The Cancel and OK (or maybe Run?) buttons are white text on very light grey. Nearly invisible.
Text field outlines seem to have the same problem. I had to click around a bit to find them.

Would there be any interest in packaging some of these scripts up with PyInstaller and so on for demo purposes?

https://github.com/nelsonjchen/gooey-pyinstaller-demo

I made this demo project last year that demos using Gooey with PyInstaller and building it on Azure Pipelines.

https://github.com/MahApps/MahApps.Metro/releases/tag/2.0.0-alpha.83

Do you think it might be helpful to release out exes/.app versions of these applications to give users quick samples of Gooey applications? The MahApps.Metro example I linked above could be considered a demo for their widget library.

Port examples to Python 3

Now that Gooey support Python 3, perhaps the examples should be ported over? Or maybe two separate versions of the examples is an okay solution

GooeyExamples/
├─ examples
└─ py2examples

I imagine it should be a simple 2to3 *.py, but I haven't really studied the examples in detail (yet), I just discovered this issue today when trying to run the examples for the first time.

Secure coding is not enabled

2024-03-17 22:44:10.450 Python[84598:6131747] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.

I get this with a simple script that just has
@gooey
def main (argv):
...

`ImportError: cannot import name 'Events' from 'gooey'` when running `python3.8 examples/lifecycle_hooks.py`

Describe the bug
running python3.8 examples/lifecycle_hooks.py generates an exception: `ImportError: cannot import name 'Events' from 'gooey'.

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/chriskiehl/GooeyExamples.git
  2. cd GooeyExamples
  3. pip install -r requirements.txt
  4. python3.8 examples/lifecycle_hooks.py
  5. Observe exception:
Traceback (most recent call last):
  File "examples/lifecycle_hooks.py", line 4, in <module>
    from gooey import Events, Gooey, GooeyParser
ImportError: cannot import name 'Events' from 'gooey' (/.../python3.8/site-packages/gooey/__init__.py)

Expected behavior
Example runs without error

Desktop (please complete the following information):

  • OS: MacOS 12.0.1

unexpected keyword argument 'metavar'

Traceback (most recent call last):
  File "GooeyExamples\examples\simple_demo.py", line 30, in <module>
    main()
  File "gooey\python_bindings\gooey_decorator.py", line 58, in inner2
    return payload(*args, **kwargs)
  File "GooeyExamples\examples\simple_demo.py", line 24, in main
    help='I turn things on and off')
  File "gooey\python_bindings\gooey_parser.py", line 28, in add_argument
    self.parser.add_argument(*args, **kwargs)
  File "C:\Anaconda\lib\argparse.py", line 1294, in add_argument
    action = action_class(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'metavar'

with today's clone of /GooeyExamples, and this version

pip install gooey
import gooey
print gooey.__version__

0.8.11.1

richtext_demo is only displaying plaintext

Describe the bug
richtext_demo is only displaying plaintext

To Reproduce
Steps to reproduce the behavior:

  1. clone repo git clone https://github.com/chriskiehl/GooeyExamples.git
  2. install dependencies C:\Users\kevin\dev\python>pip install -r GooeyExamples\requirements.txt
  3. run richtext_demo.py
C:\Users\kevin\dev\python>python -V
Python 3.9.13

C:\Users\kevin\dev\python>python GooeyExamples\examples\richtext_demo.py
  1. Observe that it is plaintext
    image

This is the same behavior through WSL on python 3.8 (VcXsrv)

Expected behavior
richtext_demo to show like this:
image

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 11

  • Version: Python on 3.9.13

  • [ x ] OS

  • [ x ] Python Version

  • Gooey Version

  • Thorough description of problem

    • Expected Behavior
    • Actual Behavior
  • A minimal code example -- preferably copy/pastable in the issue itself (less time figuring out how to run your code == more time debugging!)

  • Screenshot (if visual quirk)

Additional context
N/A

No protocol specified Unable to access the X Display, is $DISPLAY set properly?

After I install Gooey and go to the GooeyExamples-master directory use this command:
pip install -r requirements.txt

The above commands all execute correctly.

it@it51:~/GooeyExamples-master/examples$ sudo python widget_demo.py
[sudo] password for ankon:
Writing Build Config to: gooey_config.json
No protocol specified
Unable to access the X Display, is $DISPLAY set properly?

The graphics card of my computer is Quadro P4000 , and the command "nvidia-smi" show :
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.31 Driver Version: 440.31 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+

How do I solve this problem: Unable to access the X Display, is $DISPLAY set properly?

How can I use FileChooser to choose a directory?

I have a parameter that is a directory. I tried to use FileChooser for it but the UI doesn't allow me to choose directories, only files. If I click on a directory and the click Open it opens the directory instead of choosing it. If I select a file and click Open, it choose it.

I'm using MscOS.

captura de pantalla 2016-10-29 a las 11 20 24

Richtext crashes

Describe the bug

Traceback (most recent call last):
  File "/Users/admin/sources/combiner/combiner.py", line 145, in <module>
    main()
  File "/usr/local/lib/python3.11/site-packages/gooey/python_bindings/gooey_decorator.py", line 128, in inner2
    return payload(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/sources/combiner/combiner.py", line 136, in main
    args = parser.parse_args()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gooey/python_bindings/gooey_parser.py", line 125, in parse_args
    return self.parser.parse_args(args, namespace)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gooey/python_bindings/gooey_decorator.py", line 123, in run_gooey
    application.run(build_spec)
  File "/usr/local/lib/python3.11/site-packages/gooey/gui/application.py", line 21, in run
    app, _ = build_app(build_spec)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gooey/gui/application.py", line 27, in build_app
    return _build_app(build_spec, app)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gooey/gui/application.py", line 40, in _build_app
    gapp = GooeyApplication(merge(build_spec, imagesPaths))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gooey/gui/containers/application.py", line 47, in __init__
    self.console = Console(self, buildSpec)
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gooey/gui/components/console.py", line 21, in __init__
    self.textbox = RichTextConsole(self)
                   ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gooey/gui/components/widgets/richtextconsole.py", line 45, in __init__
    self.esc = colored.style.ESC
               ^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'ESC'

To Reproduce
Steps to reproduce the behavior:

  1. Using @Gooey(progress_regex=r"^Progress: (?P<current>\d+)/(?P<total>\d+)$", progress_expr="current / total * 100",show_restart_button=False, richtext_controls=True)
  2. Run program: see Error above
  3. Removing richtext_controls=True fixes it, but this isn't expected behavior.

Expected behavior

  1. No bug at all.

Desktop (please complete the following information):

  • Mac 13.3.1
  • Python 3.11.4
  • Gooey Version 1.0.8.1

dynamic_updates.py doesn't run

Python3

Traceback (most recent call last):
  File "dynamic_updates.py", line 110, in <module>
    main()
  File "/usr/local/lib/python3.6/site-packages/gooey/python_bindings/gooey_decorator.py", line 83, in inner2
    return payload(*args, **kwargs)
  File "dynamic_updates.py", line 53, in main
    args = parser.parse_args()
  File "/usr/local/lib/python3.6/site-packages/gooey/python_bindings/gooey_parser.py", line 113, in parse_args
    return self.parser.parse_args(args, namespace)
  File "/usr/local/lib/python3.6/site-packages/gooey/python_bindings/gooey_decorator.py", line 78, in run_gooey
    application.run(build_spec)
  File "/usr/local/lib/python3.6/site-packages/gooey/gui/application.py", line 15, in run
    app = build_app(build_spec)
  File "/usr/local/lib/python3.6/site-packages/gooey/gui/application.py", line 24, in build_app
    gapp = GooeyApplication(merge(build_spec, imagesPaths))
  File "/usr/local/lib/python3.6/site-packages/gooey/gui/containers/application.py", line 65, in __init__
    self.fetchExternalUpdates()
  File "/usr/local/lib/python3.6/site-packages/gooey/gui/containers/application.py", line 150, in fetchExternalUpdates
    self.buildSpec['encoding']
  File "/usr/local/lib/python3.6/site-packages/gooey/gui/seeder.py", line 15, in fetchDynamicProperties
    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: "'/usr/local/opt/python3/bin/python3.6' -u 'dynamic_updates.py' gooey-seed-ui --ignore-gooey": "'/usr/local/opt/python3/bin/python3.6' -u 'dynamic_updates.py' gooey-seed-ui --ignore-gooey"

Python 2

Traceback (most recent call last):
  File "dynamic_updates.py", line 108, in <module>
    main()
  File "/Library/Python/2.7/site-packages/gooey/python_bindings/gooey_decorator.py", line 83, in inner2
    return payload(*args, **kwargs)
  File "dynamic_updates.py", line 53, in main
    args = parser.parse_args()
  File "/Library/Python/2.7/site-packages/gooey/python_bindings/gooey_parser.py", line 113, in parse_args
    return self.parser.parse_args(args, namespace)
  File "/Library/Python/2.7/site-packages/gooey/python_bindings/gooey_decorator.py", line 78, in run_gooey
    application.run(build_spec)
  File "/Library/Python/2.7/site-packages/gooey/gui/application.py", line 15, in run
    app = build_app(build_spec)
  File "/Library/Python/2.7/site-packages/gooey/gui/application.py", line 24, in build_app
    gapp = GooeyApplication(merge(build_spec, imagesPaths))
  File "/Library/Python/2.7/site-packages/gooey/gui/containers/application.py", line 65, in __init__
    self.fetchExternalUpdates()
  File "/Library/Python/2.7/site-packages/gooey/gui/containers/application.py", line 150, in fetchExternalUpdates
    self.buildSpec['encoding']
  File "/Library/Python/2.7/site-packages/gooey/gui/seeder.py", line 15, in fetchDynamicProperties
    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

no module name wx

I'm getting the following errors when I run simple_demo.py

import simple_demo.py
Traceback (most recent call last):
File "", line 1, in
File "simple_demo.py", line 7, in
from gooey import Gooey, GooeyParser
File "gooey/init.py", line 2, in
from gooey.python_bindings.gooey_decorator import Gooey
File "gooey/python_bindings/gooey_decorator.py", line 14, in
from gooey.gui import application
File "gooey/gui/application.py", line 5, in
import wx
ImportError: No module named wx

Any recommendations?

Subparser Demo is not parsing data

I have tested the Subparser demo you have on your example,

parser.parse_args()

Problem is it cannot parse any data from the second tab, can only get the first tab data only.

Have tried several way and could not find any way to achieve to run without any problem

TypeError: Font(): arguments did not match any overloaded call

Running examples/simple_demo.py:

python simple_demo.py 
Traceback (most recent call last):
  File "simple_demo.py", line 28, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/Gooey-0.9.2.5-py2.7.egg/gooey/python_bindings/gooey_decorator.py", line 71, in inner2
    return payload(*args, **kwargs)
  File "simple_demo.py", line 24, in main
    args = parser.parse_args()
  File "/usr/lib/python2.7/site-packages/Gooey-0.9.2.5-py2.7.egg/gooey/python_bindings/gooey_parser.py", line 59, in parse_args
    return self.parser.parse_args(args, namespace)
  File "/usr/lib/python2.7/site-packages/Gooey-0.9.2.5-py2.7.egg/gooey/python_bindings/gooey_decorator.py", line 66, in run_gooey
    application.run(build_spec)
  File "/usr/lib/python2.7/site-packages/Gooey-0.9.2.5-py2.7.egg/gooey/gui/application.py", line 19, in run
    controller = Controller(build_spec)
  File "/usr/lib/python2.7/site-packages/Gooey-0.9.2.5-py2.7.egg/gooey/gui/controller.py", line 10, in __init__
    self.view = BaseWindow(layout_type=self.model.layout_type)
  File "/usr/lib/python2.7/site-packages/Gooey-0.9.2.5-py2.7.egg/gooey/gui/windows/base_window.py", line 42, in __init__
    self._init_components()
  File "/usr/lib/python2.7/site-packages/Gooey-0.9.2.5-py2.7.egg/gooey/gui/windows/base_window.py", line 110, in _init_components
    self.head_panel = header.FrameHeader(parent=self)
  File "/usr/lib/python2.7/site-packages/Gooey-0.9.2.5-py2.7.egg/gooey/gui/windows/header.py", line 29, in __init__
    self._init_components()
  File "/usr/lib/python2.7/site-packages/Gooey-0.9.2.5-py2.7.egg/gooey/gui/windows/header.py", line 54, in _init_components
    self._header = wx_util.h1(self, '')
  File "/usr/lib/python2.7/site-packages/Gooey-0.9.2.5-py2.7.egg/gooey/gui/util/wx_util.py", line 26, in h1
    return _header(parent, label, (wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False))
  File "/usr/lib/python2.7/site-packages/Gooey-0.9.2.5-py2.7.egg/gooey/gui/util/wx_util.py", line 34, in _header
    font = wx.Font(font_size * 1.2, *styles)
TypeError: Font(): arguments did not match any overloaded call:
  overload 1: too many arguments
  overload 2: argument 1 has unexpected type 'float'
  overload 3: argument 1 has unexpected type 'float'
  overload 4: argument 3 has unexpected type 'FontWeight'
  overload 5: argument 1 has unexpected type 'float'
  overload 6: argument 1 has unexpected type 'float'
  overload 7: argument 1 has unexpected type 'float'

unexpected keyword argument 'progress_regex'

Traceback (most recent call last):
  File "GooeyExamples\examples\example_progress_bar_1.py", line 11, in <module>
    @Gooey(progress_regex=r"^progress: (\d+)%$")
TypeError: Gooey() got an unexpected keyword argument 'progress_regex'

subparser_demo.py example issues ValueError when run

@ line 33:

Traceback (most recent call last):
  File "subparser_demo.py", line 95, in <module>
    main()
  File "/usr/lib/python3.8/site-packages/gooey/python_bindings/gooey_decorator.py", line 87, in inner2
    return payload(*args, **kwargs)
  File "subparser_demo.py", line 33, in main
    curl_parser.add_argument('--dump-header', type=argparse.FileType,
  File "/usr/lib/python3.8/site-packages/gooey/python_bindings/gooey_parser.py", line 88, in add_argument
    self.parser.add_argument(*args, **kwargs)
  File "/usr/lib/python3.8/argparse.py", line 1376, in add_argument
    raise ValueError('%r is a FileType class object, instance of it'
ValueError: <class 'argparse.FileType'> is a FileType class object, instance of it must be passed

The line is:

curl_parser.add_argument('--dump-header', type=argparse.FileType,
                             help='Write the protocol headers to the specified file')

Ditto for similar line 64.

OS: Linux (Manjaro 18.1.4)
Python version: 3.8.0
Gooey version: 1.0.3

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.