Terry J. Reedy added the comment:
I rebooted and reran build in case this was another funny heisenbug. It isn't.
Before patch, start 3.6 repository IDLE. Click Options, Configure IDLE, and
Keys tab. Look at 'Use a Custom Key Set'. It says 'Terry', which is correct.
After patch: repeat. It says 'IDLE Modern Unix'. Custom Key Binding box
reflects change. Repeat with 3.5 repository IDLE: it still says Terry. Ditto
for installed 3.6.0a2.
My custom [Keys] section:
[Keys]
default = False
name2 = IDLE Modern Unix
name = Terry
The problem is that name2 should be treated only as default, never as custom,
and should be used only if default=True. This is true in CurrentTheme.
However, your revised CurrentKeys uses it first and unconditionally. Hence the
observed behavior.
CurrentKeys should use the same logic as CurrentTheme. In fact, the common
logic should factored out into a separate function with two or three parameters
and used by both.
If, as you claim, CurrentTheme is buggy, it should be fixed before using it as
the template for both. To test and claim that it was future proof, I did
something like the following last fall. First set config-main.cfg [Keys] name2
to something non-existent, that might be added in the future.
[Theme]
default = True
name2 = IDLE Future
name = Custom Dark
Then start, for instance, 3.5.2. The non-existent IDLE Future is ignored and
replaced with the default default IDLE Classic, as intended in the code. No
warnings. What exactly did you do to claim otherwise?
---
Also wrong, even with your patch removed: '()Use a Built-in Key Set' says IDLE
Classic Mac (slightly grayed) on all versions. If I select built-in, change
built-in selection to IDLE Classic Windows, select custom again, click [OK] to
close, and reopen, the unselected built-in has switched back to Mac. This must
be a pre-existing bug that makes Classic Mac the default builtin when custom is
selected, This is in spite of config-main.def having
[Keys]
default= 1
name= IDLE Classic Windows
This, of course, is also wrong on non-Windows, which is why you changed it.
But it is also being ignored when custom is selected.
The problem must be in how configdialog gets the default key set when the
current keyset is custom. The widget is a DynOptionMenu, created in
CreatePageKeys, line 335, with no content. The options are set in LoadKeyCfg,
lines 1055 and 1069. The latter is used when the current key is custom. It
sets the grayed out default option to the alphabetically first among default
key sets.
itemList = idleConf.GetSectionList('default', 'keys')
itemList.sort()
self.optMenuKeysBuiltin.SetMenu(itemList, itemList[0])
itemList[0] should be replaced by your new system-sensitive
idleConf.DefaultKeys().
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue27173>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com