Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE: Update feature classes when options are changed. #75669

Open
terryjreedy opened this issue Sep 16, 2017 · 4 comments
Open

IDLE: Update feature classes when options are changed. #75669

terryjreedy opened this issue Sep 16, 2017 · 4 comments
Assignees
Labels
3.7 (EOL) end of life topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@terryjreedy
Copy link
Member

BPO 31488
Nosy @terryjreedy, @csabella
PRs
  • bpo-31488: IDLE - update former extensions when options change. #3612
  • [3.6] bpo-31488: IDLE - update former extensions when options change. (GH-3612) #3613
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = None
    created_at = <Date 2017-09-16.04:16:21.665>
    labels = ['expert-IDLE', 'type-bug', '3.7']
    title = 'IDLE: Update feature classes when options are changed.'
    updated_at = <Date 2017-09-16.06:14:36.766>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2017-09-16.06:14:36.766>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = False
    closed_date = None
    closer = None
    components = ['IDLE']
    creation = <Date 2017-09-16.04:16:21.665>
    creator = 'terry.reedy'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31488
    keywords = ['patch']
    message_count = 3.0
    messages = ['302318', '302324', '302326']
    nosy_count = 2.0
    nosy_names = ['terry.reedy', 'cheryl.sabella']
    pr_nums = ['3612', '3613']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue31488'
    versions = ['Python 3.6', 'Python 3.7']

    @terryjreedy
    Copy link
    Member Author

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

    @terryjreedy terryjreedy added the 3.7 (EOL) end of life label Sep 16, 2017
    @terryjreedy terryjreedy self-assigned this Sep 16, 2017
    @terryjreedy terryjreedy added topic-IDLE type-bug An unexpected behavior, bug, or error labels Sep 16, 2017
    @terryjreedy
    Copy link
    Member Author

    New changeset 5777ecc by Terry Jan Reedy in branch 'master':
    bpo-31488: IDLE - update former extensions when options change. (bpo-3612)
    5777ecc

    @terryjreedy
    Copy link
    Member Author

    New changeset 77b52e4 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6':
    [3.6] bpo-31488: IDLE - update former extensions when options change. (GH-3612) (bpo-3613)
    77b52e4

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @erlend-aasland
    Copy link
    Contributor

    Are there more work to be done here, or can we close this issue?

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    Status: In Progress
    Development

    No branches or pull requests

    2 participants