Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Richtext crashes #39

Open
3 tasks
tianshuo opened this issue Dec 11, 2023 · 1 comment
Open
3 tasks

Richtext crashes #39

tianshuo opened this issue Dec 11, 2023 · 1 comment

Comments

@tianshuo
Copy link

tianshuo commented Dec 11, 2023

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
@tianshuo tianshuo changed the title Richtext demo Richtext crashes Dec 11, 2023
@chrakts
Copy link

chrakts commented Aug 8, 2024

Python 3.11.5
Gooey Version 1.0.8.1
Windows 11
For me it is the same behaviour:
Using richtext_controls=True produces the error message.
Using richtext_controls = False does not produce the error, but the styles are without effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants