Skip to content

Releases: chriskiehl/Gooey

Gooey 1.2.0-ALPHA

04 Feb 02:56
Compare
Choose a tag to compare
Gooey 1.2.0-ALPHA Pre-release
Pre-release

Gooey 1.2.0-ALPHA Pre-Release!

Warning:

Upgrade with caution! 1.2.0 removes the experimental Dynamic Updates feature and replaces it with a new experimental Dynamic Updates feature! The two APIs are incompatible.

This release brings a whole host of new features to Gooey. Chief among them are the new Dynamic Updates and Validation functionality. This was effectively a rebuild of a substantial portion of Gooey's internal to enable a more client/server style functionality. This means that you have more control over the gooey's lifecycle, and can subscribe to high level events. Currently, FormSubmit, OnComplete, and OnError are supported, but more are on their way! Soon you'll be able to have fine grained control over the UI and its presentation, and still without having to write a single line of traditional GUI code!

Breaking Changes (1.0.8 -> 1.2.0)

  • Validation - the validation mechanism available via gooey_options has been removed entirely in favor of the new API.
  • Dynamic Updates - there was previously minimal support for loading new data at run time. This has been revomed in favor of a new system which gives advanced control over the state of the UI.

New Features

  • Dynamic Updates and Validation - Checkout the README for details on how to get started. This feature is really hairy behind the scenes and involves all kinds of crazy monkey patching in order to work. Odds of encountering a bug or scenario that doesn't work for your use case is high in this initial release. Please fill out an issue if any problems pop up! Checkout the examples repo to see the new lifecycle hooks in action.
  • Graceful Shutdown control - Gooey previously would SIGTERM your application when you tried to halt it while running. However, with 1.2.0, you have control over which signal Gooey sends when you request a shutdown. This gives you a chance to catch that signal and clean up and resources currently un use before shutting down.
  • Better sys.argv handling - Gooey no longer mutates the global sys.argv variable. This caused people all kinds of problems -- most frequent being Gooey spawning multiple windows. This is now removed, and hopefully all the pain stemming from it as well.

Gooey 1.0.8.1

12 Jun 18:51
Compare
Choose a tag to compare

Gooey 1.0.8.1 Released!

This is a tiny intermediate release which just loosen Gooey's WxPython dependency from =4.1.0 to >=4.1.0 in setup.py. The strict version requirement was causing numerous installation issues across environments.

Gooey 1.0.8

20 Dec 01:40
Compare
Choose a tag to compare

Gooey 1.0.8 Released!

Another minor Gooey release! This one brings a new global Gooey Option for setting initial values in the UI, support for version action types, plus a few bug/linting fixes.

Additionally, I continue to plug away at getting the test coverage to useful levels. We're now pushing 80% coverage which is making working on Gooey with confidence much easier!

New Gooey Options: initial_value

This option lets you specify the value present in the widget when Gooey starts.

parser.add_argument('-my-arg', widget='Textarea', gooey_options={
    'initial_value': 'Hello world!'  
})

Or, using the new options helpers:

from gooey import options 
parser.add_argument('-my-arg', widget='Textarea', gooey_options=options.Textarea(
    initial_value='Hello World!'
))

If you've been using Gooey awhile, you'll recognize that this overlaps with the current behavior of default. The new initial_value enables you to supply a truly optional seed value to the UI. When using default, even if the user clears your value out of the UI, argparse will add it back in when it parses the CLI string. While this is often useful behavior, it prevents certain workflows from being possible. initial_value let's you control the UI independent of argparse. This means you can now, for instance, set a checkbox to be checked by default in the UI, but optionally allow the user to deselect it without having argprase re-populate the 'checked' state (a behavior which comes up frequently in the issue tracker due to it being technically correct, but also very confusing!).

action=version support

When using action='version' Gooey will now map it a CheckBox widget type.

Other Fixes / Changes:

  • Bug fix: add missing translation step for tabbed group titles (@neonbunny)
  • Linting: swap is not for != (@DrStrinky)

Breaking Changes

No breaking API changes from 1.0.7 to 1.0.8

Thank you to the current Patreon supporters!

  • Sponsors:
    • Qteal
  • Individuals:
    • Joseph Rhodes
    • Nicholas
    • Joey

Gooey 1.0.7

29 Nov 19:38
Compare
Choose a tag to compare

Gooey 1.0.7 Released!

Lots of new stuff this release! We've got 3 new widget types, new gooey_options, as well as some quality of Life improvements for using Gooey Options.

New Widgets: IntegerField, DecimalField, and Slider

Gooey now has 3 inputs specifically geared towards accepting numeric inputs. Previously, all Gooey had were text fields which you could add validators to in order to enforce only numbers were entered, but now we have top level widgets which do all of that out of the box!

Important Usage Note: since these numeric inputs don't allow any non-numeric characters to be entered, they do not give you the ability to blank them out. Unlike a TextField which can be left empty and thus have its value not passed to your program, the numeric inputs will always send a value. Thus, you have to have sane handling in user-land.

Checkout the Options docs for more details.

New Gooey Options: placeholder

Widgets with text inputs now all accept a placeholder Gooey option.

add_argument('--foo', widget='TextField', gooey_options=options.TextField(
    placeholder='Type some text here!'
)

# or without the options helper 
add_argument('--foo', widget='TextField', gooey_options={
    'placeholder': 'Type some text here!'
})

New Validator option: RegexValidator

add_argument('--foo', widget='TextField', gooey_options=options.TextField(
    placeholder='Type some text here!',
    validator=options.RegexValidator(
        test='\d{4}',
        message='Must be exactly 4 digits long!'
    )
)

# or without the options helper 
add_argument('--foo', widget='TextField', gooey_options={
    'placeholder': 'Type some text here!',
    'validator': {
        'type': 'RegexValidator',
        'test': '\d{4}',
        'message': 'Must be exactly 4 digits long!'
    }
})

New feature: Options helpers

Gooey now has a top-level options module which can be imported. Previously, Gooey Options have been an opaque map. While great for openness / extensibility, it's pretty terrible from a discoverability / "what does this actually take again..?" perspective. The new options module aims to make using gooey_options easier and more discoverable.

from gooey import options

The goal is to enable IDE's to provide better auto-completion help as well as more REPL driven usefulness via help() and docstrings.

from gooey import options

parser.add_argument(
    '--foo', 
    help='Some foo thing',
    widget='FilterableDropdown',
    gooey_options=options.FilterableDropdown(
        placeholder='Search for a Foo',
        search_strategy=options.PrefixSearchStrategy(
            ignore_case=True 
        )
    ))

Note that these are just helpers for generating the right data shapes. They're still generating plain data behind the scenes and thus all existing gooey_options code remains 100% compatible.

Better Docs:

Which is to say, documentation which actually exists rather than not exist. You can inspect the docs live in the REPL or by hopping to the symbol in editors which support such things.

>>> from gooey import options 
>>> help(options.RadioGroup) 
Help on function FileChooser in module __main__:

FileChooser(wildcard=None, default_dir=None, default_file=None, message=None, **layout_options)
    :param wildcard: Sets the wildcard, which can contain multiple file types, for 
                     example: "BMP files (.bmp)|.bmp|GIF files (.gif)|.gif"
    :param message:  Sets the message that will be displayed on the dialog.
    :param default_dir: The default directory selected when the dialog spawns 
    :param default_file: The default filename used in the dialog
    
    Layout Options:
    ---------------
    
    Color options can be passed either as a hex string ('#ff0000') or as
    a collection of RGB values (e.g. `[255, 0, 0]` or `(255, 0, 0)`)
    
    :param label_color:    The foreground color of the label text
    :param label_bg_color: The background color of the label text.
    :param help_color:     The foreground color of the help text.
    :param help_bg_color:  The background color of the help text.
    :param error_color:    The foreground color of the error text (when visible).
    :param error_bg_color: The background color of the error text (when visible).
    :param show_label:     Toggles whether or not to display the label text
    :param show_help:      Toggles whether or not to display the help text
    :param visible:        Hides the entire widget when False. Note: the widget
                           is still present in the UI and will still send along any
                           default values that have been provided in code. This option
                           is here for when you want to hide certain advanced / dangerous
                           inputs from your GUI users.
    :param full_width:     This is a layout hint for this widget. When True the widget
                           will fill the entire available space within a given row.
                           Otherwise, it will be sized based on the column rules
                           provided elsewhere. 

Ideally, and eventually, we'll be able to completely type these options to increase visibility / usability even more. However, for backwards compatibility reasons, Gooey will continue to be sans anything more than the most basic of type hinting for the time being.

Breaking Changes

No breaking API changes from 1.0.6 to 1.0.7. However, the strictness of existing Gooey Options has been increased, which could result in issues when upgrading from 1.0.6. In an attempt to be helpful, Gooey now throws an exception if invalid Gooey Options are supplied. This is to catch things like invalid types or ill-formed data. If you were passing bad data in 1.0.6, it will now be flagged as such in 1.0.7.

Thank you to the current Patreon supporters!

  • Sponsors:
    • Qteal
  • Individuals:
    • Joseph Rhodes
    • Nicholas

Gooey 1.0.6

15 Nov 03:30
Compare
Choose a tag to compare

Gooey 1.0.6 Released!

This is a minor release beefing up the new FilterableDropdown's search capabilities and performance. In the previous release, the dropdown was backed by WX's ListBox widget. 1.0.6 replaces this for a fully virtualized version which allows Gooey to operate on massive datasets without taking a hit to UI performance. Additionally, how Gooey internally filters for matches has also been updated. Choice are now backed by a trie for super fast lookup even against large data sets. Tokenization and match strategies can be customized to support just about any lookup style.

Head over to the Examples Repo to see the updated demo which now uses a datset consisting of about 25k unique items.

New Gooey Options:

FilterableDropdown now takes a search_strategy in its gooey_options.

from gooey import Gooey, GooeyParser, PrefixTokenizers

gooey_options={
    'label_color': (255, 100, 100),
    'placeholder': 'Start typing to view suggestions',
    'search_strategy': {
        'type': 'PrefixFilter',
        'choice_tokenizer': PrefixTokenizers.ENTIRE_PHRASE,
        'input_tokenizer': PrefixTokenizers.REGEX('\s'),
        'ignore_case': True,
        'operator': 'AND',
        'index_suffix': False
    }
})

This gives control over how the choices and user input get tokenized, as well as how those tokenized matches get treated (ANDed together vs ORd). Want to match on any part of any word? Enable the index_suffix option to index all of your candidate words by their individual parts. e.g.

Word: 'Banana' 
Suffixes: ['Banana', 'anana', 'nana', 'ana']

These all get loaded into a trie for super fast lookup. Combine this with the WORDs tokenizer, and you get really fine grained search though your options!

Thank you to the current Patreon supporters!

  • Qteal
  • Joseph Rhodes

Breaking Changes

No breaking changes from 1.0.5.

Gooey 1.0.5

08 Nov 01:38
Compare
Choose a tag to compare

Gooey 1.0.5 Released!

Gooey is now using WX 4.1.0!

This change should resolve several issues in Ubuntu as well as the numerous other quirks which have been reported.

Thank you to the current Patreon supporters!

  • Qteal
  • Joseph Rhodes

New widgets:

FilterableDropdown

Filterable Dropdown

You can checkout a runnable example in the GooeyExamples repo here

Example Code:

add_argument(
    choices=['a', 'b', 'c'],
    widget='FilterableDropdown',
    gooey_options={
        'no_match': 'No results found!',
        'placeholder': 'Type something!'
})

This introduces a new language translation key: "no_matches_found" to handle the case where the user's input doesn't match any of the choices. This is used by default, but can be overridden via gooey options

Elapsed Time / Estimated time remaining

fbHcpCAGD8

@JackMcKew put in a herculean effort and introduced a new feature where elapsed and estimated remaining time can be shown in addition to the standard progress bar.

You can checkout an example here

Example Code:

@Gooey(timing_options={
    'show_time_remaining':True,
    'hide_time_remaining_on_complete':True
})

Breaking Changes

  • (documentation breaking)terminal_font_weight's public documented API allowed the strings "NORMAL" and "BOLD" while its internal implementation relied on numeric font weights (light=200, normal=300, etc..). The documentation was updated to show the correct usage and a constants file was added to the public API.

Functionality

  • @neonbunny enabled Parsers to use configuration from parents.
  • @eladeyal-intel updated RichTextConsole to allow control+scrollwheel to zoom the text

Language Additions / Improvements

  • @soleil0-0 - Additional Chinese translation
  • @dancergraham - Additional French translation
  • @ajvirSingh1313 - Hindi translation

Bug Fixes

  • Fixed bug where dynamic updates to a Dropdown would cause the selection to be lost
  • Fixed performance issues where dynamic updates with large items would cause Gooey to hang
  • @rotu fixed a bug in dynamic updates related to Popen usage.
  • @neonbunny - resolved warning cause by missing return statement
  • Fixed bug where terminal font and colors were not being set correctly
  • Fixed mysterious RadioGroup issue where underlying WxWidgets would 'forget' the current selection under certain circumstances

Gooey 1.0.4

21 Jun 20:11
Compare
Choose a tag to compare

Gooey 1.0.4 Released!

Gooey picked up some cool new widget types thanks to awesome contributions from @NathanRichard and @conradhilley.

The rest of this release was focused on bug fixes and quality improvements. My commitment is to having Gooey be a stable, reliable project. This has required slowly shedding it's fast and loose hobby project past. Test coverage more than doubled between 1.0.3 and 1.0.4 and several bugs were fixed along the way as a result of this. The next few releases of Gooey will be similarly focused on bringing its codebase up to snuff so that wider changes can be made without introducing unexpected regressions.

Upgrading from 1.0.3 to 1.0.4

Translation notice! Yes/No options in confirmation modals are now backed by the language files. Previously, they were fixed to english regardless of the selected language. If the new language options aren't configured for your language, you will now see a translation request in the button label!

What's new

Widgets: TimeChooser

Usage:

parser = GooeyParser()
parser.add_argument('--time', widget='TimeChooser')

@NathanRichard added this one after an excellent deep dive into the complexities of dealing with time inside of WX. See the README for notes on usage.

Widgets: ColourChooser

Usage:

parser = GooeyParser()
parser.add_argument('--color', widget='ColourChooser')

@conradhilley brought this one to life. You can now select colors from an awesome little chooser widget.

CLI based defaults

@jschultz added the ability to use arguments passed on the command line as defaults in Gooey. Enable this functionality by passing use_cmd_args to the Gooey decorator.

@Gooey(use_cmd_args=True)
def main():
    parser = ArgumentParser()
    parser.add_argument('--foo')

Now any CLI args you pass when invoking your program will show up as defaults in Gooey.

python my_program.py --foo "hello!" 

Additional features

  • Added option to start Gooey in full screen mode

Language Additions / Improvements

Bug Fixes

  • Main README image had a typo "Command Lines Applications"
  • Truthy values
  • Fixed bug where nargs in textfields weren't being mapped correctly
  • Fixed bug where argparse's SUPPRESS flag was showing in the UI
  • Fixed missing i18n capabilities in modals
  • Fixed bug where program_description wasn't being honored
  • Fixed bug where gooey_options weren't being honored in the Header
  • Fixed bug where RadioGroup wasn't enabling it's child widget when initial_selection was set
  • Fixed bug where checkboxes weren't honoring visibility options
  • Fixed bug where gooey_options weren't being passed to footer

Gooey 1.0.3.1 Hotfix

25 Apr 22:34
Compare
Choose a tag to compare

This is a temporary hotfix downgrading the wxpython used by Gooey to 4.0.7.

WxPython 4.10 introduced unexpected breaking changes. These changes caused Gooey to fail when starting up.

If you are seeing errors such as this when running Gooey

wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_CENTRE_HORIZONTAL)" failed at ..\..\src\common\sizer.cpp(2106) in wxBoxSizer::DoInsert(): Horizontal alignment flags are ignored in horizontal sizers

This release will resolve them.

Longer term solution to follow pending additional research.

Gooey 1.0.3 Released!

22 Sep 19:30
Compare
Choose a tag to compare

title card

After cooking for far too long, Gooey 1.0.3 is released!

Grab the latest version:

Runnable demos for all the new features can be found in the Examples repo.

Overview:

A lot of focus was put on settling Gooey down into a more stable mature project. In addition to all of the new features, a lot of time was spent writing documentation, stamping down cross platform issues / quirks, and making numerous tweaks and additions to enable a smoother experience when packaging Gooey for distribution.

What's new

Fancy Layout controls!

advanced layout

The main goal of this release was enabling more complex real-world layouts and more customization of Gooey's UI. As of 1.1.0, you now have have control over every color, font, and display status within the application. You can now brand Gooey to your organization's colors, logically group related items under a central heading, and optionally show/hide all the individual components that make up an input widget.

Menu Bars

Gooey now includes a simple declarative system for creating top level menu bars and items.

menu bar

The menu option currently supports three flavors:

AboutDialog

This is an AboutDialog as rendered natively by your OS. It's a good place to show standard info like version info, descriptions, licenses, etc.. in a standard way across platforms.

MessageDialogs

Next up are general message dialogs. You can display any informational text inside of these.

Link

Finally, you can create fixed menu items that simply link to external resources, for instance, your site, documentation, pdfs, etc..

Rich Text Controls

Thanks to @NathanRichard, Gooey can now optionally honor terminal control sequences and display Rich Text in the output panel.

rich text

New Gooey Program Icon

New icon provided by professional cool guy and crazy talented UX designer Justin Rhee.

Additional features

  • OSX now shows program Icon in Dock
  • show_error_modal option to toggle whether or not failures additionally raise alert modals.
  • BlockCheckbox widget.
  • Hyperlinks written to the console appear as such and will launch a browser on click
  • clear_before_run option lets you control whether or not subsequent program runs start from a fresh terminal or preserve the previous output.
  • Conditionally show/hide restart button
  • requires_shell option - controls how Popen spawns your program. By default (and historically), this value is False.
  • Optionally silence textual progress updates when using the Progress widget (via @conradhilley)
  • Multi-Directory Choosers - these were accidentally dropped from the project. @HenrykHaniewicz added them back!
  • Additional explicit wx imports to make packaging on OSX easier
  • Textfields can now be made Readonly for informational purposes
  • better custom target support via suppress_gooey_flag which prevents the --ignore-gooey flag from being injected

Breaking Changes

No breaking changes between 1.0.0 and 1.1.0!

Language Additions / Improvements

Bug Fixes

  • Fixed 5 year old bug(!) where an errant lambda function wasn't passing through all of its arguments which caused frustratingly opaque failures under specific conditions.
  • Fixed bug where external updates weren't applied to ListBox
  • Fix bug where tuples weren't coerced to List which causes concatenation errors
  • Fixed bug where string coercion in argparse_to_json was too broad and caused type errors
  • Fixed bug where wrong validator was applied to Dropdown type causing preflight checks to always fail
  • Fixed bug where Radio Groups would apply too much vertical spacing between components
  • Fixed bug where subgroups with single items were attached to the wrong UI parent
  • Fixed bug where legacy default groups weren't being translated
  • Fixed bug where certain languages would sometimes cause components to be rendered off screen