This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE: Update feature classes when options are changed.
Type: behavior Stage: patch review
Components: IDLE Versions: Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: cheryl.sabella, terry.reedy
Priority: normal Keywords: patch

Created on 2017-09-16 04:16 by terry.reedy, last changed 2022-04-11 14:58 by admin.

Pull Requests
URL Status Linked Edit
PR 3612 merged terry.reedy, 2017-09-16 05:25
PR 3613 merged python-dev, 2017-09-16 05:42
Messages (3)
msg302318 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-16 04:16
For this issue, a 'feature class' is a non-extension class with options configured on the config dialog.  Currently there are 4 such classes, which were extension classes before conversion by #27099.

Currently, an extension class option takes effect either when IDLE is restarted and the module reads the value, or when a new instance is created and the instance reads the value.  There is currently no mechanism to update existing instances.

As part of the conversion, I gave each feature class a reload classmethod.  The method is called at module level after the class is created.  The idea was that these methods could also be called from ConfigDialog.activate_config_changes.  This issue implements this idea.

(Cheryl: testing the new code should be ideally be part of this patch and should be part of new tests for activate_config_changes you have worked on.  I am going with manual tests for the moment because the cutoff for 3.6.3rc1 and 3.7.0a1 is next Monday, 12 UTC, about 55 hours from now.)

If instances reread the class attribute each time they need it, then updating the class attribute updates all existing instances.  An example is the autocomplete popup delay time.

If instances only read the class attribute in __init__ and somehow freeze the value, then the class needs to keep track of instances so reload can refresh each.  A current example of freezing is the parenmatch type.  I will have to either unfreeze the attribute or add a registry set.

Fixing up CodeContext will be a separate patch I am already working on.  

Applying the reload idea to extensions, in particular the example extension, is a much lower priority, and can wait until after the pending releases.
msg302324 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-16 05:42
New changeset 5777ecc438790f3d324d52f2ccdad56e667e0cb3 by Terry Jan Reedy in branch 'master':
bpo-31488: IDLE - update former extensions when options change. (#3612)
https://github.com/python/cpython/commit/5777ecc438790f3d324d52f2ccdad56e667e0cb3
msg302326 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-16 06:14
New changeset 77b52e463ab9f8bea7703ff9c03c06b3ec889db7 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31488: IDLE - update former extensions when options change. (GH-3612) (#3613)
https://github.com/python/cpython/commit/77b52e463ab9f8bea7703ff9c03c06b3ec889db7
History
Date User Action Args
2022-04-11 14:58:52adminsetgithub: 75669
2017-09-16 06:14:36terry.reedysetmessages: + msg302326
2017-09-16 05:42:42python-devsetpull_requests: + pull_request3604
2017-09-16 05:42:30terry.reedysetmessages: + msg302324
2017-09-16 05:25:04terry.reedysetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request3603
2017-09-16 04:16:21terry.reedycreate