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: Refactor breakpoint related methods #66281

Open
SaimadhavHeblikar mannequin opened this issue Jul 26, 2014 · 3 comments
Open

IDLE: Refactor breakpoint related methods #66281

SaimadhavHeblikar mannequin opened this issue Jul 26, 2014 · 3 comments
Labels
3.9 only security fixes topic-IDLE type-feature A feature request or enhancement

Comments

@SaimadhavHeblikar
Copy link
Mannequin

SaimadhavHeblikar mannequin commented Jul 26, 2014

BPO 22083
Nosy @terryjreedy
Files
  • pyshell-breakpoint-refactor.diff
  • pyshell-breakpoint-refactor-v2.diff
  • 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 = None
    closed_at = None
    created_at = <Date 2014-07-26.15:06:23.497>
    labels = ['expert-IDLE', 'type-feature', '3.9']
    title = 'IDLE: Refactor breakpoint related methods'
    updated_at = <Date 2019-09-19.18:18:00.349>
    user = 'https://bugs.python.org/SaimadhavHeblikar'

    bugs.python.org fields:

    activity = <Date 2019-09-19.18:18:00.349>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['IDLE']
    creation = <Date 2014-07-26.15:06:23.497>
    creator = 'Saimadhav.Heblikar'
    dependencies = []
    files = ['36112', '36348']
    hgrepos = []
    issue_num = 22083
    keywords = ['patch']
    message_count = 3.0
    messages = ['224062', '224909', '225194']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'jesstess', 'Saimadhav.Heblikar']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22083'
    versions = ['Python 3.9']

    @SaimadhavHeblikar
    Copy link
    Mannequin Author

    SaimadhavHeblikar mannequin commented Jul 26, 2014

    This refactoring is required to enable setting/clearing breakpoints, using linenumbering( whether using a Canvas implementation or a Text implementation http://bugs.python.org/issue17535)
    The patch ensures consistency between the set_breakpoint(_here) and
    clear_breakpoint(_here) methods. The clear_breakpoint_here, which is not present currently has been added.
    No functionality has been added or removed, so I think it should be safe to go forward.

    @SaimadhavHeblikar SaimadhavHeblikar mannequin added the topic-IDLE label Jul 26, 2014
    @terryjreedy
    Copy link
    Member

    The _here methods are the event handlers for the right click context menu options. Set_breakpoint, as a separate method, is only needed in the restore_file_breaks (from breakpoint file) method. I gather that you are thinking of using set/clear_breakpoint when a line number is clicked.

    You have elsewhere suggested a different refactoring - replacing set and clear with toggle. That seems plausible as a good idea. If text will have no breakpoints set after
    self.text.update() # this enables setting "BREAK" tags to be visible
    in restore_file_breaks(), there would be no problem. If not, toggle would need a force_set option. We need to know when the circumstances of when restore_file_breaks is called.

    The bell is both undependable and uniformative. If breakpoints are not allowed for unnamed files, the context menu items should be grayed out (if possible, as done, for instance, for 'cut' when there is no selectionj). If a line numbers is clicked for unnamed, we should display a message box explaining.

    @terryjreedy terryjreedy added the type-feature A feature request or enhancement label Aug 6, 2014
    @SaimadhavHeblikar
    Copy link
    Mannequin Author

    SaimadhavHeblikar mannequin commented Aug 11, 2014

    This patch does two things

    1. Refactor pyshell-breakpoint-refactor.diff to reflect changes in pyshell-breakpoint-refactor.diff

    As in pyshell-breakpoint-refactor.diff, the set/clear(_here) breakpoint methods are refactored into logical methods.

    1. If the filename is not set, text.bell() is replaced with a dialog to prompt the user to save the file.

    @terryjreedy terryjreedy added the 3.9 only security fixes label Sep 19, 2019
    @terryjreedy terryjreedy changed the title Refactor PyShell's breakpoint related methods IDLE: Refactor breakpoint related methods Sep 19, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes topic-IDLE type-feature A feature request or enhancement
    Projects
    Status: No status
    Development

    No branches or pull requests

    1 participant