[New-bugs-announce] [issue27380] IDLE: add base Query dialog with ttk widgets

Terry J. Reedy report at bugs.python.org
Fri Jun 24 00:15:17 EDT 2016

New submission from Terry J. Reedy:

The custom popup entry dialogs in config_sec and config_help have a common structure and overlapping code.  When one hits OK and the entry is not valid, both display a specific message and let the user edit the entry (or Cancel).

File => Load Module, on the other hand, uses tkSimpleDialog.askstring.  No error checking is done before the box disappears.  If there is an error, even a simple misspelling, one must start over.  It is really annoying to use.  I want to replace this with a custom popup that would be the same as the one in config_sec, except for title, prompt, and validation function.  If the name given has multiple conponents, such as idlelib.idelhelp.help_xyz, I would like to report which is the first invalid component (going from left to right).

I am therefore adding a new module, query.py, with a new Query class that will be the baseclass for three derived classes.

The partial patch renames config_sec.py (formerly configSectionNameDialog.py) to query.py.  The corresponding test_config_sec) becomes test_query.  It splits class GetCfgSectionNameDialog into a base class Query and a subclass SectionName.  Query is responsible for the popup, and used ttk widgets as appropriate.  SectionName overrides the entry validation function entry_ok (formerly name_ok).  The test functions have been similarly split.

What remains are ModuleName and HelpSource subclasses, corresponding tests, and integration with the software that would use them.

assignee: terry.reedy
files: query.diff
keywords: patch
messages: 269154
nosy: terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: IDLE: add base Query dialog with ttk widgets
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file43526/query.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list