Gooey

Latest version: v1.0.8.1

Safety actively analyzes 688568 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

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](https://user-images.githubusercontent.com/1408720/97120143-6649fc00-16d2-11eb-95a9-f8c49cae055f.gif)

You can checkout a runnable example in the GooeyExamples repo [here](https://github.com/chriskiehl/GooeyExamples/blob/1.0.5-release/examples/FilterableDropdown.py)

Example Code:

python
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](https://user-images.githubusercontent.com/19178331/85913252-592d1580-b876-11ea-8def-25b12732b9cb.gif)

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](https://github.com/chriskiehl/GooeyExamples/blob/master/examples/example_time_remaining.py)

Example Code:

python
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

1.1.0

Language Additions / Improvements

* Completed Italian translation - gison93

* Updated French translation - NathanRichard
* Updated Hebrew translation - eturkes



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

1.0.8.1

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.

1.0.8

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.

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


Or, using the new `options` helpers:

python
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](https://www.patreon.com/chriskiehl)!

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

1.0.7

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

<p align="center"><img src="https://github.com/chriskiehl/GooeyImages/raw/images/docs/releases/1.0.7/numeric-inputs.gif" ></p>


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](https://github.com/chriskiehl/Gooey/blob/master/docs/Gooey-Options.md) for more details.


New Gooey Options: placeholder

<p align="center"><img src="https://github.com/chriskiehl/GooeyImages/raw/images/docs/releases/1.0.7/placeholders.gif" ></p>

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

python
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

python
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.

python
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.

python
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](https://www.patreon.com/chriskiehl)!

* Sponsors:
* Qteal
* Individuals:
* Joseph Rhodes
* Nicholas

1.0.6

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](https://github.com/chriskiehl/GooeyExamples) 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`.

python
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.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.