Skip to content

Richtext crashes #39

@tianshuo

Description

@tianshuo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions