Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-1529353: IDLE: squeeze large output in the shell#7626

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
taleinat merged 19 commits intopython:masterfromtaleinat:bpo-1529353
Sep 25, 2018

Conversation

taleinat
Copy link
Contributor

@taleinattaleinat commentedJun 11, 2018
edited by bedevere-bot
Loading

[fname, None],
['.' + fname.lower(), __package__],
[fname.lower(), None],
]:
Copy link
Member

Choose a reason for hiding this comment

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

Given that the code you are expending worked fine, what is the point of this? It apears to be extraneous to adding squeezer.

Copy link
Member

Choose a reason for hiding this comment

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

If you email a response, please clip the quote.

In 3.6, I made all idlelib file names lower case and broke ext filename == section name.
In compensation, I added a mapping
extfiles = { # Map built-in config-extension section names to file names. ...
beforedef load_extension(self, name): and a new first line:
fname = self.extfiles.get(name, name)
that also works with added non-built-in extensions with filename == section-name,

This patch should add a line to the map:
'Squeezer': 'squeezer',
and leave load_extension alone.

Copy link
ContributorAuthor

@taleinattaleinatJun 13, 2018
edited
Loading

Choose a reason for hiding this comment

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

This is required to avoid naming the fileSqueezer (note the capitalization). It won't be needed if we rework this to not use the extensions mechanism.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks for the clarification@terryjreedy!

I think this won't be needed anyways, but if we keep it as an extension I'll make the change you described.

@taleinattaleinatforce-pushed thebpo-1529353 branch 3 times, most recently from9564154 to9f6dc5fCompareAugust 13, 2018 13:55
@terryjreedy
Copy link
Member

I pulled and has no merge problem with repository updated 12 hours ago, contrary to Appveyor merge failure. There does not seem to be a way to tell Appveyor and only Appveyor to try again, so lets wait until another push.

'View' better than 'Preview'. Popup looks good.

50 lines seems sensible default, but
for i in range(100): print(i)
does not trigger squeeze. I think a few long lines should also, if feasible.

Refinement: box colors. 'Light' box looks good on dark theme. I would like the box to indicate the type of text squeezed, with error color dominating normal color. So pink background for traceback and bluish for no error. I will experiment with what I like with 'normal' light theme. This might be left to a followup.

Options should take effect on Ok/Apply and not require restart. This should be easy, but perhaps needs better documentation in configdialog.py. If you work on this, post a note, as will I.

I would like just one option line, for trigger condition or conditions (if we add 'characters').

Why would anyone want an invisible button?

I think we can pick a popup time that appears nearly instant but skips popup if swipe cursur over 'quickly'. 80 ms seems about right.

I intend to look at code and issue questions tomorrow.

@taleinat
Copy link
ContributorAuthor

@terryjreedy

Options should take effect on Ok/Apply and not require restart.

They do, except that existing expanding buttons don't have their tooltip config updated. I've looked into this and getting it working properly is surprisingly complex.

Perhaps we can just do away with the two tooltip config opitons (whether to show at all and how long to delay before showing)?

Otherwise I'll get it working.

@taleinat
Copy link
ContributorAuthor

@terryjreedy

Refinement: box colors. 'Light' box looks good on dark theme. I would like the box to indicate the type of text squeezed, with error color dominating normal color. So pink background for traceback and bluish for no error. I will experiment with what I like with 'normal' light theme. This might be left to a followup.

Note that there is already a definition for "error" colors, we might consider using those (or just the background).

FWIW I find the existing colors satisfactory in both the light and dark themes. The default colors (black text on a light-gray background) are also okay IMO.

If we use something else, I think we should make the colors configurable, so that users can match them to their configuration.

@terryjreedy
Copy link
Member

I resolved the merge conflict, with the following as the merged text.

    self.text = text = Text(self, wrap='word', highlightthickness=0)    color_config(text)    text.grid(row=0, column=0, sticky=N+S+E+W)    self.grid_rowconfigure(0, weight=1)    self.grid_columnconfigure(0, weight=1)

I verified that changing min lines takes immediate effect. Everything else seems the same.

I never see a horizontal scrollbar, so maybe there is a bug there. I don't consider this essential. 100 char lines in a standard or narrowed window do not trigger a scrollbar. Instead, lines wrap. The text window works fine for the About IDLE displays, including with user colors.

@terryjreedy
Copy link
Member

FAIL: test_nowrap (idlelib.idle_test.test_textview.ViewFunctionTest)

Traceback (most recent call last):
File "/home/travis/build/python/cpython/Lib/idlelib/idle_test/test_textview.py", line 135, in test_nowrap
self.assertEqual(text_widget.cget('wrap'), 'none')
AssertionError: 'word' != 'none'

  • word
  • none

This can be fixed by changing or skipping the test, but perhaps this is why I see wrapping instead of a scrollbar. I am looking at the test and code.

@terryjreedy
Copy link
Member

view_test passes wrap to ViewWindow to ViewFrame to TextFrame but not to Text because my merge resolution did not merge the Text call. Fixing now.

@terryjreedy
Copy link
Member

With the fixes,python -m test -ugui test_idle passes, butpython -m test.test_idle fails 10 times. All the tests that use Text fail with

    text_widget = Text()  File "F:\dev\3x\lib\tkinter\__init__.py", line 3101, in __init__    Widget.__init__(self, master, 'text', cnf, kw)  File "F:\dev\3x\lib\tkinter\__init__.py", line 2292, in __init__    BaseWidget._setup(self, master, cnf)  File "F:\dev\3x\lib\tkinter\__init__.py", line 2262, in _setup    self.tk = master.tkAttributeError: 'NoneType' object has no attribute 'tk'

This is because when test_idle is run as main, tk.NoDefaultRoot() is called first. Serhiy Storchaka recommended that IDLE should not use the default root mechanism, because it has problems, and test that it does not. The call used to be in the main body, so tests could never use default root. But then this caused another issue with other tests, and I moved it into the if-main clause.

When I run just the squeezer tests from squeezer.py or test_squeezer.py, the tests pass, but a blank tk window is left over. I am a little surprised that we don't get a warning from the CI bot, as not destroying root as part of teardown has previously caused order-dependent problems when IDLE tests are run as part of the Pyhton test suite. Maybe some non-CI buildbots are stricter.

Given both these issues, I would rather wait to merge until these are fixed. I both know how and am willing to do so.

Docstring sentences should start with Caps and end with periods. (PEP8).

Up to now, IDLE test classes have used SomethingTest (noun) rather than TestSomething, leaving the test_something verb for for methods. Do you have a strong preference for verb-form class names?

@taleinat
Copy link
ContributorAuthor

@terryjreedy

With the fixes,python -m test -ugui test_idle passes, butpython -m test.test_idle fails 10 times.

Fixed in latest commit.

@taleinat
Copy link
ContributorAuthor

@terryjreedy

Docstring sentences should start with Caps and end with periods. (PEP8).

Done.

Up to now, IDLE test classes have used SomethingTest (noun) rather than TestSomething, leaving the test_something verb for for methods. Do you have a strong preference for verb-form class names?

Changed.

@taleinattaleinat merged commit604e7b9 intopython:masterSep 25, 2018
@miss-islington
Copy link
Contributor

Thanks@taleinat for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

csabella reacted with hooray emoji

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 25, 2018
(cherry picked from commit604e7b9)Co-authored-by: Tal Einat <taleinat+github@gmail.com>
@bedevere-bot
Copy link

GH-9561 is a backport of this pull request to the3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 25, 2018
(cherry picked from commit604e7b9)Co-authored-by: Tal Einat <taleinat+github@gmail.com>
@bedevere-bot
Copy link

GH-9562 is a backport of this pull request to the3.6 branch.

miss-islington added a commit that referenced this pull requestSep 25, 2018
(cherry picked from commit604e7b9)Co-authored-by: Tal Einat <taleinat+github@gmail.com>
miss-islington added a commit that referenced this pull requestSep 25, 2018
(cherry picked from commit604e7b9)Co-authored-by: Tal Einat <taleinat+github@gmail.com>
@taleinattaleinat deleted the bpo-1529353 branchSeptember 25, 2018 12:39
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@terryjreedyterryjreedyterryjreedy left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@taleinat@terryjreedy@miss-islington@bedevere-bot@the-knights-who-say-ni

[8]ページ先頭

©2009-2025 Movatter.jp