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

bpo-17942: major rework of debugger UI #22947

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

roseman
Copy link
Contributor

@roseman roseman commented Oct 24, 2020

  • updated to use ttk widgets throughout
  • simplified controls, changed go/step/etc. to image buttons
  • overall layout is a two-pane horizontal window (controls, stack, status on left, variables on right)
  • treeview widget used to replace custom scrolled-listbox stackviewer and custom canvas-based namespaceviewer
  • integrated locals/globals into a single treeview on right; can collapse/expand each independently instead of having checkboxes to control whether shown or not
  • removed scrolledlist.py (was previously used only by stackview)

https://bugs.python.org/issue17942

@E-Paine
Copy link
Contributor

@E-Paine E-Paine commented Oct 25, 2020

Is it possible to do without using preset image sizes and font? (if for some reason the default font is larger than normal, the difference is very obvious). Even if we cannot change the image and font sizes dynamically, I think we should avoid fixing the family.

roseman added 3 commits Oct 25, 2020
- updated to use ttk widgets throughout
- simplified controls, changed go/step/etc. to image buttons
- overall layout is a two-pane horizontal window (controls, stack, status on left, variables on right)
- treeview widget used to replace custom scrolled-listbox stackviewer and custom canvas-based namespaceviewer
- integrated locals/globals into a single treeview on right; can collapse/expand each independently instead of having checkboxes to control whether shown or not
was being used by stack trace in debugger
- button captions now use TkIconFont (a bit bigger than before)
- status line now uses default font, plus derives italic variation for errors
@roseman roseman marked this pull request as draft Oct 25, 2020
@roseman roseman force-pushed the debugger-new-ui-17942 branch from 06a7185 to a8b8da4 Compare Oct 25, 2020
@roseman
Copy link
Contributor Author

@roseman roseman commented Oct 25, 2020

Oops, sorry about the committed merge (can you tell I'm not using git every day)? In any case, I've changed the hard-coded fonts as per Elisha's comment.

@roseman roseman marked this pull request as ready for review Oct 25, 2020
@methane methane removed their request for review Oct 26, 2020
@markshannon markshannon removed their request for review Oct 27, 2020
Copy link
Contributor

@E-Paine E-Paine left a comment

Massive visual improvement over the original! We have a few methods which don't do anything (add_varheader, mouse_moved_vars and leave_vars): I assume there's a plan for them but for now should we add a TODO to them?

Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
Lib/idlelib/debugger.py Show resolved Hide resolved
Lib/idlelib/debugger.py Show resolved Hide resolved
Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
Lib/idlelib/debugger.py Show resolved Hide resolved
Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
Copy link
Member

@terryjreedy terryjreedy left a comment

I only reviewed the comments, not the whole patch.

I verified that scrolled list is only used here and can go if not used here.
What is the replacement?

Lib/idlelib/debugger.py Show resolved Hide resolved
Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
func = match.group(1) + '.' + func
else:
func = selfval.__class__.__name__ + '.' + func
except Exception:
Copy link
Member

@terryjreedy terryjreedy Nov 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly prefer that we not add more bare exceptions. Certainly not without a justification comment.

Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
# we've probably got the string representation of the
# object sent from the remote debugger, see if we can
# parse it into something useful
match = re.match('^<(?:.*)\.([^\.]*) object at 0x[0-9a-f]+>$',
Copy link
Member

@terryjreedy terryjreedy Nov 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Special chars are normal inside [] without \, so I think [^\.] and [^.] have the same effect (I prefer the latter) so that [^\\.] is needed to match 3 all 3 chars. Prefix r suppress strings escapes, but there are none, so I think it has no effect, though some prefer to use it for all REs. Outside the brackets, '\.' matches literal period, which is what want, whereas '\\.' matches multiple backslashes? I am not sure why later periods are excluded. CPython now prints addresses with A-F.

In any case, non-trivial REs should be defined at the top of the file so that they can be tested.

# we've probably got the string representation of the
# object sent from the remote debugger, see if we can
# parse it into something useful
match = re.match('^<(?:.*)\.([^\.]*) object at 0x[0-9a-f]+>$',
Copy link
Member

@terryjreedy terryjreedy Nov 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this is correct. See previous comment about testing REs

Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Nov 1, 2020

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@terryjreedy
Copy link
Member

@terryjreedy terryjreedy commented Nov 2, 2020

All REs with '' should be prefixed with 'r' because uses like . and \d not recognized by standard string processing are deprecated and will become errors in the future.

roseman and others added 3 commits Nov 2, 2020
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
Lib/idlelib/debugger.py Show resolved Hide resolved
@roseman
Copy link
Contributor Author

@roseman roseman commented Nov 4, 2020

cleaned up the code and documentation in add_stackframee... not a shock but it was actually not doing anything as is because the 're' module hadn't been imported, which the bare exception oh-so-helpfully hid.. 😬

@E-Paine
Copy link
Contributor

@E-Paine E-Paine commented Nov 4, 2020

Just a general thing, is there a way to make the panedwindow more obvious? (when I first looked at the new design, I mistook it for padding until I looked at the code)

Copy link
Member

@terryjreedy terryjreedy left a comment

Follow PEP-8 in comments and my comment on clarifying debugger separation.

The IDLE Doc says of debugger "This feature is still incomplete and somewhat experimental. " Would you consider this still true after this patch?

Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
Lib/idlelib/debugger.py Outdated Show resolved Hide resolved
@E-Paine
Copy link
Contributor

@E-Paine E-Paine commented Nov 4, 2020

Ubuntu failure related to issue 42142 (I have noted this there)

@terryjreedy
Copy link
Member

@terryjreedy terryjreedy commented Nov 4, 2020

@E-Paine Thank you. GH will not let me download the failure log.

@E-Paine
Copy link
Contributor

@E-Paine E-Paine commented Nov 17, 2020

  1. I believe all review comments have been addressed except for the lazy/greedy regex one

  2. Does anyone have a high-dpi monitor to test this patch on? (I am concerned that the images will be too small so very hard to see on such a monitor)

@roseman
Copy link
Contributor Author

@roseman roseman commented Dec 6, 2020

related to issue #14111... i note that the 'stop' button in the in-progress debugger ui is actually doing 'quit' (and doesn't in fact work when in the middle of a busy loop).

i think it would make sense to add a 'pause' button beside go, which can be used to pause the running program, allowing it to be continued. i'm wondering if the stop button should be renamed or icon changed to make it more clear that it will terminate the running program altogether.

should probably add tool tips on the debugger controls as well

@github-actions
Copy link

@github-actions github-actions bot commented Jan 6, 2021

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Jan 6, 2021
@rhettinger rhettinger removed their request for review May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes CLA signed stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants