classification
Title: Squeezer - squeeze large output in IDLE's shell
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: 33839 Superseder:
Assigned To: terry.reedy Nosy List: cheryl.sabella, miss-islington, serhiy.storchaka, taleinat, terry.reedy
Priority: normal Keywords: patch

Created on 2006-07-27 00:13 by taleinat, last changed 2018-10-28 17:08 by miss-islington. This issue is now closed.

Files
File name Uploaded Description Edit
Squeezer.py taleinat, 2006-07-27 00:13 Noam Raphael's original Squeezer.py (from IDLE-fork)
IDLE_Squeezer.patch taleinat, 2006-07-30 11:05 initial patch
taleinat.20140211.IDLE_Squeezer.patch taleinat, 2014-02-11 21:58 modern patch for Python 3.4 review
Squeezer_Screenshot.PNG taleinat, 2014-02-24 06:39
Pull Requests
URL Status Linked Edit
PR 7626 merged taleinat, 2018-06-11 10:43
PR 9561 merged miss-islington, 2018-09-25 12:10
PR 9562 merged miss-islington, 2018-09-25 12:10
PR 9567 merged terry.reedy, 2018-09-25 15:56
PR 9568 merged terry.reedy, 2018-09-25 16:00
PR 9569 merged miss-islington, 2018-09-25 16:09
PR 9570 merged miss-islington, 2018-09-25 16:09
PR 9571 merged miss-islington, 2018-09-25 16:10
PR 9572 merged terry.reedy, 2018-09-25 16:20
PR 10169 merged terry.reedy, 2018-10-28 07:49
PR 10179 merged miss-islington, 2018-10-28 16:45
PR 10180 merged miss-islington, 2018-10-28 16:45
Messages (59)
msg50765 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2006-07-27 00:13
Here is my improved version of Squeezer - the IDLE
extension to end all of your
oh-no-I-just-printed-War-and-Peace-in-the-interpreter
troubles!

Changes:
* Fixed line counting logic
* Line counting is done according to current window
width and current tab width
* Fixed configHandler to enable reading of raw data
from config files (100% backwards compatible) - needed
by Squeezer to enable configuration of text viewers in
config-extensions

I've been working this vesion without a hitch for
several weeks, but that's hardly enough testing is it?

Attached:
* the original Squeezer.py by Noam Raphael
* a diff against Noam's original Squeezer.py
* a diff of configHandler.py against the current SVN
version (revision 46863)
* fixed 'middle click to copy' - now works on Windows


One minor note - the 'middle click to copy' didn't work
on Windows because it simply called selection_own()
which doesn't affect the clipboard. I added
clipboard_clear() and clipboard_append() and it now
works on Windows. This should be tested on Linux, Unix,
OSX etc. to check compatibility.

For more info on the clipboard issue, see:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/647feeef55625733/bc08421d8aea9928?lnk=st&q=&rnum=2#bc08421d8aea9928
msg50766 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2006-07-27 02:49
Logged In: YES 
user_id=149084

OK, thanks.  Please take a look at the two diffs you
uploaded, they seem corrupted.  Squeezer.py looks ok.
msg50767 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2006-07-30 11:09
Logged In: YES 
user_id=1330769

Uploaded unified diffs instead of standard diffs. Probably
the first diffs had bad newlines because I'm working on Win.

Also 2 changes:
* minor fix - end case when clicking at beginning of text block
* Allow squeezing of stderr (tracebacks...)
msg50768 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2006-07-30 14:20
Logged In: YES 
user_id=149084

Ah, that's better. Thanks.
msg50769 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2007-02-05 06:05
Delete the patch to configHandler.py, implemented with Patch 1650174.
msg84637 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2009-03-30 20:24
"Test needed"? I'll need a bit of guidance on this.

Has there been a change of policy of which I'm not aware, that patches
to IDLE not going to be accepted unless comprehensive tests are included?

Much of IDLE doesn't include tests, e.g. the RPC code. There's a comment
by K.B.K. in the end of rpc.py from September '03 saying we need a
proper test suite for it, and testing that should be simple compared to
testing GUI related functionality.


In any case, if someone can suggest a simple approach to test Squeezer
I'll gladly work it up. As it is, I can think of ways to test certain
functions, but I'm not sure how to approach testing GUI related
functionality (or if I should approach this at all).
msg84645 - (view) Author: Daniel Diniz (ajaksu2) (Python triager) Date: 2009-03-30 20:48
Tal,
There is no such policy AFAIK. The stage field is a tool to help us
handle the issues, sorry to give you a wrong impression. If IDLE has no
tests, 'test needed' doesn't apply here, so we can set this to 'patch
review'.

If someone is already working on adding tests for IDLE, please revert
this to 'test needed'.
msg84657 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2009-03-30 21:36
Daniel, Thanks for clearing that up :)
msg210296 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-02-05 10:01
Ping?

Can this please go in? It's such a great improvement to user experience!

I've seen too many novice users print a ton of output by accident and have IDLE hang as a result, losing their interactive session. This simple extension avoid those issues completely, while still allowing access to the output if needed.

I'd even be willing to do any extra work required, such as testing on Windows, Linux and OSX. Just tell me what's holding this up!
msg210310 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-02-05 13:23
Could you please provide a patch which applies to default branch?

There is other proposed solution for the problem of large output: issue1442493.
msg211027 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-02-11 21:58
Here's a completely re-written patch!

The patch is against current 3.3 (changeset 360976a6d8b9), since that's what Terry requested recently on issue3068. It also applies cleanly to the current default branch (changeset 360976a6d8b9).

This patch has cleaner, modern code, with doc-strings everywhere and informative comments where appropriate. It also uses "import tkinter as tk" as Terry recently requested on issue3068.

Furthermore, I've added a very complete set of tests for the new extension, which tests everything I could think of and achieves 100% coverage (!) of Squeezer.py. These are modern tests which make extensive use of mocking via the awesome unittest.mock module. I've included extensive in-code comments with the tests. Hopefully these will be useful as a reference for writing additional tests for IDLE code (at least other extensions).

Finally, this patch includes a minor change to ToolTip.py, adding the ability to specify the delay after which a tooltip is displayed (was hard-coded to 1.5 seconds). This change is required by the extension (I prefer that it uses tooltips with no delay).
msg211068 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-02-12 09:43
Expanded text still makes IDLE unresponsible. Try print('a'*10000000).

I think it will be better to output first 100 lines and a button "More", pressing on which expands next 100 lines.
msg211071 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-02-12 09:55
During experiments I got following message on terminal:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 1482, in __call__
    return self.func(*args)
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 534, in callit
    func(*args)
  File "/home/serhiy/py/cpython/Lib/idlelib/ToolTip.py", line 44, in showtip
    x = self.button.winfo_rootx() + 20
  File "/home/serhiy/py/cpython/Lib/tkinter/__init__.py", line 845, in winfo_rootx
    self.tk.call('winfo', 'rootx', self._w))
_tkinter.TclError: bad window path name ".3066068076.3066068332.text.3048812460"

May be it is unrelated.
msg211075 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-02-12 10:07
Regarding the tooltip traceback, seems like that could be related. I added a tooltip to the "squeezed text" buttons, with no delay, so perhaps there's some kind of race condition?

Could you try changing "delay=0" in the code to "delay=50" and see if the issue goes away?

I would test this myself if you could specify how to reproduce that error.
msg211076 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-02-12 10:26
I'm not able to reproduce the problem after the first time (even with 
"delay=0").
msg211083 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-02-12 11:18
Indeed, expanding very long texts still degrades the performance of IDLE. But the user has to explicitly expand the text (by double-clicking the button) and can easily squeeze the text again.

As for your suggestion to show just the first several lines and a "more..." button, that would be a significantly more complex solution. It is already easy to preview the squeezed text, either by launching an external viewer or by copying the text to the clipboard.

Yes, a user could still get large amount of text in the shell by expanding large squeezed text. In other words, a user can still shoot himself in the foot; but now he'd have to purposefully aim the shotgun at his foot first.
msg211643 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-02-19 18:51
The test emits a lot of warnings.
msg211645 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-02-19 18:53
Serhiy, which warnings?

Some of the tests use Tk GUI elements, so they include "requires('gui')". You need to run the tests with a proper environment so that these tests are run; otherwise you get a warning that the 'gui' resource in unavailable.
msg211646 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-02-19 18:54
See related issue6143 "IDLE - an extension to clear the shell window", where special support for Squeezer is required in that extension (patch included there).
msg211647 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-02-19 19:00
Mainly deprecation warnings about assertEquals(). Run

    ./python -Wall -b -m test.regrtest -vuall test_idle
msg212021 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-02-23 18:52
See msg212020 for a Python-style explanation of the utility of the Squeezer extension.
msg212061 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-02-24 06:39
Added screenshot of what working with the IDLE shell with the Squeezer extension looks like (on Windows).

Note that the second squeezed text is the very long "Max recursion depth" exception traceback, which I manually squeezed after it was printed.
msg319291 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-06-11 10:48
New PR ready for review.

I've updated the code for recent master and cleaned up the deprecation warnings from the tests.
msg319316 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-11 16:14
Tal, welcome back to Python and IDLE development.  3.5 only gets security fixes. 

Please post here a draft doc paragraph.  Before reading the code in detail, I will pull it into my repository and try to test it as a 'naive user' who has only read that paragraph.

'Large text' has two meanings: long lines and lots of lines.  The former bog down and eventually freeze tkinter Texts.  (tk 8.7.0, now in alpha, will feature a re-written Text widget that should solve this.)  Lots of (short) lines, at least up to a million, is not a problem for Text, but is for users scrolling back.  Which problem does squeezer attack?  Both?

As the comment at the top of tooltips.py says, it is currently unused. It is also untested.   Calltips uses a version of the code. Hence, I was planning to sometime delete tooptips.py.  If it to be kept, I would like to see if it can be revised (at least TooltipBase) so it can be used both by calltips_w.py and any new code, such as squeezer.  It needs docstrings and a complete test.  This would be a separate issue that is a dependency of this one.  Since the file is so short, TooltipBase might eventually be put in another file with something else.
msg319317 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-11 16:25
Last fall, we converted built-in 'extensions' to regular features.  I am reluctant to add new 'extensions'.  But I can review the patch as an extension before we worry about this.
msg319319 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-06-11 17:09
Thanks for the warm welcome, Terry :)

> 3.5 only gets security fixes.

Yup, my mistake.

> 'Large text' has two meanings: long lines and lots of lines. [...]

Squeezer handles both long lines and/or large numbers of lines.

> As the comment at the top of tooltips.py says, it is currently unused. [...]

I'd noticed, but it's still there and it works.  I'll be happy to refactor it and add tests.

> Last fall, we converted built-in 'extensions' to regular features.  I am reluctant to add new 'extensions'.  But I can review the patch as an extension before we worry about this.

I'd noticed this too, but decided to postpone refactoring this more until I got some updated feedback.  If you'd prefer this be added in non-extension form, I can do that.

> Please post here a draft doc paragraph.

Here's a revised version of the module's doc-string:


A common problem in IDLE's interactive shell is printing large
amounts of text into the shell.  This can cause IDLE to become
very slow, even to the point of being completely unusable.  It
can also make using the scrollbar awkward.

Squeezer automatically replaces long texts with a small button,
which can be used to access the original long text in several
ways, such as copying it to the clipboard.

Additionally, any output can be manually "squeezed" by the
user.  This includes output written to the standard error
stream ("stderr"), such as exception tracebacks.
msg319339 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-11 20:16
Since this is the sort of addition that I want to test and evaluate in extended use before release, this is a good time to revive this.  3.6.6rc1 and 3.7.0rc1 are due tonight.  3.6.7 and 3.7.1 will be open for patches by tomorrow.

I opened #33839 to redoing tooltip.py.  I can test PR 7626 as is while tooltip is worked on.
msg319344 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-11 20:51
Cheryl, if you have time to try out PR 7626, I am curious what you think, as a user.  A short doc draft is 2 posts above.
msg319353 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python triager) Date: 2018-06-12 00:27
Thanks for the PR, Tal.  I've started looking at it and I have just a few initial observations:

1.  Serhiy's msg211068 still happens.  I tried his example of print('a'*1000000).  There was a noticeable delay before the button was created, then a button with 'Squeezed text (12500 lines).' appeared.  I double clicked on it and regretted it.  If providing a paging mechanism (i.e., a 'more' button) is too complicated, I think we still need an alternative way to prevent the user from clicking a button that will hose the system.  

2.  I don't have a middle button.  My mouse has 9 buttons, but none are a middle click and I can't map it on Linux.  :-(   

3.  'preview-command-posix' - I tried 'vim' and 'nano'.  Right-clicking the button opens those editors in the terminal window that I'm running IDLE from, but the text isn't displayed in the window.  When I exit from the editor, I get a traceback:
Warning (from warnings module):
  File "/cpython/Lib/subprocess.py", line 839
    ResourceWarning, source=self)
ResourceWarning: subprocess 2797 is still running


4.  list(range(500)) showed the button (for 30 lines).  I realize that it's configurable, but it seems like a low initial value.  

5.  The context menu option to manually squeeze works nicely, except that the cursor stays next to the button instead of going back to the prompt.

6.  Is it necessary to be able to hide the tooltip?

7.  I know you talked about it already, but I think this may need to be moved from Extensions before merging.  Changing a config value doesn't always immediately apply the change, so it doesn't fit in with how most config works now.  For example, I changed the 'preview' program from a value to nothing.  The option to right-click still existed and right-clicking gave a traceback:
Traceback (most recent call last):
  File "/cpython/Lib/idlelib/squeezer.py", line 181, in preview
    start_new_session=True)
  File "/cpython/Lib/subprocess.py", line 756, in __init__
    restore_signals, start_new_session)
  File "/cpython/Lib/subprocess.py", line 1499, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: ''

8.  I didn't check the source code, but I wasn't sure what 'Enable editor' did.  I *thought* it would enable squeezing in an editor window by using manual squeeze mode, but it wasn't on the context menu.

9.  Does the button color need to be configurable?  IMHO, the current yellow looks better on Dark than it looks on Classic.  But it does work for both.
msg319367 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-06-12 06:58
Cheryl, thanks for testing this and writing up your thoughts!

There is certainly much room for improvement.

Since it seems that you and Terry like the approach, I'll start working on the tooltips as Terry asked, and wait for more input from him before beginning additional work.
msg319428 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-13 06:07
Thanks, Cheryl, very helpful.  I have since played around with the patch.

Some context first.  I want to make improving Shell a major focus for a while.  Part of that is handling problematic output.  One solution is to remove it.  For instance, if I enter a statement with a name error, I would like to be able to, for instance, hit Alt-Cntl-Z ('Undo Output') and have the last prompt and output erased and the last statement made editable, with the cursor at the end.  
 
Boxing the output is an alternative to just getting rid of it.  Or in some cases, it might make it clearer that deletion is a good idea.  I think some detail's should be different for 'too long' versus 'too many'.

Initial comments using Cheryl's numbers.

1. I tried something more 'sensible': 'a'*10000 by itself and preceded by "for i in range(10): ".  I was surprised that this did not bog down my machine.  I will have to look at some old issues where I verified the problem.  (Perhaps something has improved?)  In any case, I think we should either refuse to expand something malignant or at least ask "Do you really want to kill IDLE by expanding this?"

2. I want IDLE to be more usable without a mouse, and usable with alternate mice.

3. I get the error when Notepad is opened.  For 'lots of lines', such as the 1000+ line output for help(tk.Text), the alternate window (or frame!) can and should be an IDLE edit or view window.  This will be important when IDLE becomes a tabbed application.  I would only want to use external software when a tk Text could not do the job.

8. "Enable editor = False" is needed to keep Squeezer off editor edit menus.  The extension config system has no way to differentiate between settings a user can change and those they should not.  As a feature, it would clearly be Shell only.  As I have said before, I want to move to graying-out menu items rather than inserting and deleting them.

4. I also want restrict new options to those really needed, as determined by experience.  Perhaps we can agree on a fixed cutoff.  Perhaps something like 'more than 100 lines or 5000 characters'.

9. Color option is not needed.  Use the tooltip color.  If we wanted, we could make it depend on whether the theme was light or dark.  If we did, this would be part of the Tooltip class, and not part of this issue.

5. I agree that the cursor should more.

6. Tooltips should go away when the mouse moves off the tool button, and it does.  Cheryl, not sure what you are saying here.  I should like to see the tip when moving the cursor with keys.  Perhaps the button should be replaced by tagged text.  One can click a tag as well as a button, and tab-bind and key press.

7. Making feature option changes take effect immediately was one of the improvements made with the conversion.

(new) 10. The button for 'a'*10000 says '(nn lines)'.  It should say '(10000 chars)' or '(1 line, 10000 chars)'.  The number of lines depends on the text width and changes as the width is changed.  I suspect the squeezer should be able to tell the difference, because when I prefixed 'for i in range(10):', I see 10 buttons with, for one width, '87 lines'.  After expand all and contract, to one button, I see '96 lines', which is 87 (for the first line) + 9 (for each of the rest).
msg319430 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-13 06:18
11. Right click should bring up a custom context menu.  It can have 'cut' (delete), 'copy' (to clipboard, eliminating middle click need), 'edit' (IDLE editor if it seems ok), 'view' (ditto for TextView).

Is there a standard for simulating left and right click with keys?  Whatever, it should be possible to do same with cursor beside button or within tag.
msg319452 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python triager) Date: 2018-06-13 10:51
6.  Sorry about being so vague.  I was referring to the configuration page having an option to hide/show the tooltip.  I wasn't sure if that was a necessary config option.
msg319494 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-06-14 05:17
Once the ToolTip is ready, I'll begin working on this.

Summarizing what appear to be agreed-upon changes to be made (keeping original numbering for reference):

1. Avoid expanding large output accidentally / too easily. Current suggestions are expanding part of the output with a "more..." button, and a confirmation dialog e.g. "Are you sure? This could bring IDLE to a halt! Consider other methods of viewing the output."

2. Avoid using the middle button. Either use a more commonly accessible mouse-click combo, make it a context-menu option, or make it user-configurable.

3. Make the "preview" functionality use our tkTextView (will need testing to make sure it performs reasonably).

4. Increase default minimum # lines for auto-squeezing. 50? 100?

7. Change implementation method from an extension to an integrated part of IDLE.
msg319495 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-06-14 05:30
Additional feature discussion:

> 10. The button for 'a'*10000 says '(nn lines)'.  It should say '(10000 chars)' or '(1 line, 10000 chars)'.

IMO that's too much, it leads to "information overload".  Since the number of lines shown is the number of "wrapped" lines, e.g. how many visual lines would be used, isn't that enough? W ould users really need to also know how many characters are there?

While on the subject, the labels are currently not updated when the width of the window is changed; this could be a future improvement to make (might need to be done in the background).

> 11. Right click should bring up a custom context menu.  It can have 'cut' (delete), 'copy' (to clipboard, eliminating middle click need), 'edit' (IDLE editor if it seems ok), 'view' (ditto for TextView).

'cut' and 'edit' would break the current IDLE shell convention that output above the prompt is read-only.  Squeezer currently manipulates such output, but essentially keeps it there in a different form.  This seems like a design decision you've already made, Terry, but personally I would find this rather confusing.

> Is there a standard for simulating left and right click with keys?  

Not that I'm aware of. Squeezer already has an event for expanding the last squeezed output; we could improve on the event bindings.  Some keyboards have a dedicated key for opening a context menu (used to be common), so for users with that having all of the options in the context menu would achieve the keyboard-only-usability goal.  We should likely do both, and show the keyboard shortcuts in the context menu.
msg319496 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-14 05:44
3. It is idlelib's TextView, not tkTextView.  If it is not 'good enough', we might improve it.

5. Look at former extensions, like codecontext.py, corresponding parts of editor.py.  The key thing for immediate effect is the class reload method, called when the module is imported and when ConfigDialog [Apply] or [OK] is clicked.  For the latter, the class or its method must added to a list in either in ConfigDialog or EditorWindow.
msg323471 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-08-13 09:47
I'm back to working on this.  I've made good progress: I'm nearly done with all of the changes suggested here and ready for another PR review.

I'd like some opinions on a few things:

1. Should the tooltip-related configuration options be removed?  There is one for whether to show tooltips for squeezed outputs and another to set the hover delay.  I feel that they add unnecessary complexity.

2. Should there be an option to entirely disable auto-squeezing?  Currently there is only a setting for the minimum number of lines, which can just be set very high.

3. Should we keep the events for squeezing the last output block and expanding the last squeezed output block?  ISTM the keyboard shortcuts would only be used by "power users", which aren't our main target.  Further, without keyboard shortcuts, I see no point for having these events at all, given that it is easy to achieve this otherwise.

4. Is it worth the effort to update the number of lines displayed for squeezed outputs when a shell window's width is changed?
msg324255 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-08-28 15:00
I've gone ahead and addressed all of the significant issues raised here:

* Squeezer is no longer an extension
* Expanding problematically large outputs prompts the user for confirmation
* "copy" and "view" moved to a right-click context menu
* use IDLE's TextView for viewing squeezed outputs
  * I added the ability to set the text wrapping
* default minimum # lines for auto-squeezing increased to 50

I've also updated all of the tests accordingly and added a few.

There a several tweaks to consider, including those mentioned in my previous message, plus colors and key bindings.

This is now ready for another review!
msg324365 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-08-30 04:37
I partly answered questions already.

1. Yes.  Always show.  Fix delay at 80 until we decide on something better.

2. No.  Max should be enough.  I once printed over 500_000 short lines to see if scrolling remained responsive.  It did.  I could have set min to 1_000_000 for that experiment.  Am I correct in presuming that only one block of output, between code imputs, can be squeezed?

Converting extensions to features mostly removed the option to omit features.

3. No, if not gone already.  I don't want to proliferate keyboard shortcuts, at least not until we get rid of some that must be nearly unused.

I want to make revising the use of keys within output blocks a separate issue.

4. Maybe nnnn chars would be better.

'a'*1000 currently wraps to 13 80-char lines.  (This would change if we add horizontal scrollbar, as has been requested.)  The viewer does not wrap.  I think it should as there is now no way to see entire line.  Or it needs a scrollbar.  Viewer is modal, but does it need to be?
msg324374 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-08-30 09:36
> 1. Yes.  Always show.  Fix delay at 80 until we decide on something better.

Done.

> 2. No.  Max should be enough.

Done.

> I once printed over 500_000 short lines to see if scrolling remained responsive.  It did.  I could have set min to 1_000_000 for that experiment.  Am I correct in presuming that only one block of output, between code imputs, can be squeezed?

Indeed.

> 3. No, if not gone already.  I don't want to proliferate keyboard shortcuts, at least not until we get rid of some that must be nearly unused.

Done.

> 4. Maybe nnnn chars would be better.

I'm still not sure, that just leads to very large numbers, where it's hard to judge what is excessive, e.g., "is 100,000 chars too much"?  With lines, I feel it is more obvious: "1,000 lines? That's way too much!"

> The viewer does not wrap.  I think it should as there is now no way to see entire line.  Or it needs a scrollbar.

Wrapping is the major cause of the text widget slowing down, which is why I've made the viewer support controlling the wrapping mode, and made Squeezer use no wrapping.  I've now added a horizontal scrollbar, and also made the scrollbars in the viewer appear only when needed.  Now, scrolling horizontally with very long lines is still slow, but at least just the viewer is affected.

> Viewer is modal, but does it need to be?

No, good catch, changed to non-modal.
msg326100 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-09-22 17:35
The PR is ready for another review.

ISTM it should be good to go, after have addressing all of the significant issues brought up in the discussion here.
msg326310 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-09-25 02:01
Tal, if you think this is ready, I would like to get this in the upcoming releases.  I believe the deadline is midnight at the international dateline, which is noon UTC tomorrow, just over 9 hours from now. 

I decided that any suggestions I might have for the non-user-visible aspects of squeezer.py and test_squeezer.py can wait for later.  The best review of user-visible aspects will come from using it.

A second use of squeezer should be debugger's global and non-global('local') namespace displays.  The intended format is one name-value pair per line.  But values can be indefinitely large.  For this, we could skip the context menu (there is not one now), use a fixed trigger of n characters, and have double-click display to a popup Squeezer View.

I will come back to this in a couple of hours to see if you have responded.  I would write and merge a separate expanded news entry for idlelib/NEWS.txt.
msg326343 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-09-25 11:42
Working on getting this in now. Just in time, it seems.
msg326347 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-09-25 12:05
This seems like it would need a "What's New" entry.

How does this work with IDLE re. new features being backported?
msg326348 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-09-25 12:10
New changeset 604e7b9931f9e7881a2941816e538f5f15930db8 by Tal Einat in branch 'master':
bpo-1529353: IDLE: squeeze large output in the shell (GH-7626)
https://github.com/python/cpython/commit/604e7b9931f9e7881a2941816e538f5f15930db8
msg326349 - (view) Author: miss-islington (miss-islington) Date: 2018-09-25 12:38
New changeset 321f28c5f4b7361fa1b6330697b28481b4565ec8 by Miss Islington (bot) in branch '3.7':
bpo-1529353: IDLE: squeeze large output in the shell (GH-7626)
https://github.com/python/cpython/commit/321f28c5f4b7361fa1b6330697b28481b4565ec8
msg326350 - (view) Author: miss-islington (miss-islington) Date: 2018-09-25 12:39
New changeset 0b3e1208033aa1eb5452afe9387f86f299ef24e5 by Miss Islington (bot) in branch '3.6':
bpo-1529353: IDLE: squeeze large output in the shell (GH-7626)
https://github.com/python/cpython/commit/0b3e1208033aa1eb5452afe9387f86f299ef24e5
msg326368 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-09-25 16:09
New changeset dac712d51667227ce3862fc61be6a8094b1066fa by Terry Jan Reedy in branch 'master':
bpo-1529353: IDLE: Squeezer What's New for 3.6.7 (#9567)
https://github.com/python/cpython/commit/dac712d51667227ce3862fc61be6a8094b1066fa
msg326369 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-09-25 16:09
New changeset ea718d377db3941ecfc86288a3465fce653cc682 by Terry Jan Reedy in branch 'master':
bpo-1529353: IDLE - Squeezer What's New for 3.7.1 (#9568)
https://github.com/python/cpython/commit/ea718d377db3941ecfc86288a3465fce653cc682
msg326370 - (view) Author: miss-islington (miss-islington) Date: 2018-09-25 16:15
New changeset 98c8236cc75529407e305f26de95d9e72a72a0eb by Miss Islington (bot) in branch '3.6':
bpo-1529353: IDLE: Squeezer What's New for 3.6.7 (GH-9567)
https://github.com/python/cpython/commit/98c8236cc75529407e305f26de95d9e72a72a0eb
msg326371 - (view) Author: miss-islington (miss-islington) Date: 2018-09-25 16:15
New changeset 92ad2612bef198f2e3f8f09bf552189e27afcc4e by Miss Islington (bot) in branch '3.7':
bpo-1529353: IDLE: Squeezer What's New for 3.6.7 (GH-9567)
https://github.com/python/cpython/commit/92ad2612bef198f2e3f8f09bf552189e27afcc4e
msg326372 - (view) Author: miss-islington (miss-islington) Date: 2018-09-25 16:18
New changeset 3637e68d7c92eda0b80e6ab3f58610e1cfb4f1d8 by Miss Islington (bot) in branch '3.7':
bpo-1529353: IDLE - Squeezer What's New for 3.7.1 (GH-9568)
https://github.com/python/cpython/commit/3637e68d7c92eda0b80e6ab3f58610e1cfb4f1d8
msg326373 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-09-25 16:44
See my 3.6/3.7 patches for how I now handle new-in-maintenance-release user-visible features in What's New.  Note that there are similar entries for Python at the bottom of the file.

If I were not rushing, I would have mentioned user colors in text view.  But that is minor and I will add one entry for colors and font sizes in both text and help views when done.
msg326374 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-09-25 16:45
New changeset fdcb5ae25c0b5c82a32955617d253810ef110cac by Terry Jan Reedy in branch 'master':
bpo-1529353: IDLE - Squeezer What's New for 3.8 (#9572)
https://github.com/python/cpython/commit/fdcb5ae25c0b5c82a32955617d253810ef110cac
msg326419 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-09-26 05:56
ISTM that this issue can finally be closed!

Followup on some remaining minor points brought up here, such as colors and squeezing of multiple output lines printed separately, could be done in separate issues or discussed on idle-dev.
msg326445 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-09-26 11:40
Yes. Congratulations on your persistence.
msg328703 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-10-28 16:44
New changeset 68d6dc0770288075504635a8e42696070823fd69 by Terry Jan Reedy in branch 'master':
bpo-1529353: Explain Shell text squeezing in the IDLE doc. (#10169)
https://github.com/python/cpython/commit/68d6dc0770288075504635a8e42696070823fd69
msg328710 - (view) Author: miss-islington (miss-islington) Date: 2018-10-28 17:03
New changeset 8dccb00c197e7b4f6ce65950a9ed6802fa217094 by Miss Islington (bot) in branch '3.7':
bpo-1529353: Explain Shell text squeezing in the IDLE doc. (GH-10169)
https://github.com/python/cpython/commit/8dccb00c197e7b4f6ce65950a9ed6802fa217094
msg328711 - (view) Author: miss-islington (miss-islington) Date: 2018-10-28 17:08
New changeset 69ab28d2a616ae0234b6e412a979400523b2a6d9 by Miss Islington (bot) in branch '3.6':
bpo-1529353: Explain Shell text squeezing in the IDLE doc. (GH-10169)
https://github.com/python/cpython/commit/69ab28d2a616ae0234b6e412a979400523b2a6d9
History
Date User Action Args
2018-10-28 17:08:26miss-islingtonsetmessages: + msg328711
2018-10-28 17:03:23miss-islingtonsetmessages: + msg328710
2018-10-28 16:45:15miss-islingtonsetpull_requests: + pull_request9503
2018-10-28 16:45:00miss-islingtonsetpull_requests: + pull_request9502
2018-10-28 16:44:48terry.reedysetmessages: + msg328703
2018-10-28 07:49:01terry.reedysetpull_requests: + pull_request9493
2018-09-26 11:40:17terry.reedysetstatus: open -> closed
resolution: fixed
messages: + msg326445

stage: patch review -> resolved
2018-09-26 05:56:33taleinatsetmessages: + msg326419
2018-09-25 16:45:34terry.reedysetmessages: + msg326374
2018-09-25 16:44:21terry.reedysetmessages: + msg326373
2018-09-25 16:20:32terry.reedysetpull_requests: + pull_request8974
2018-09-25 16:18:03miss-islingtonsetmessages: + msg326372
2018-09-25 16:15:18miss-islingtonsetmessages: + msg326371
2018-09-25 16:15:07miss-islingtonsetmessages: + msg326370
2018-09-25 16:10:05miss-islingtonsetpull_requests: + pull_request8973
2018-09-25 16:09:55terry.reedysetmessages: + msg326369
2018-09-25 16:09:18miss-islingtonsetpull_requests: + pull_request8972
2018-09-25 16:09:09miss-islingtonsetpull_requests: + pull_request8971
2018-09-25 16:09:00terry.reedysetmessages: + msg326368
2018-09-25 16:00:19terry.reedysetpull_requests: + pull_request8970
2018-09-25 15:56:27terry.reedysetpull_requests: + pull_request8969
2018-09-25 12:39:17miss-islingtonsetmessages: + msg326350
2018-09-25 12:38:50miss-islingtonsetnosy: + miss-islington
messages: + msg326349
2018-09-25 12:10:35miss-islingtonsetpull_requests: + pull_request8964
2018-09-25 12:10:28miss-islingtonsetpull_requests: + pull_request8963
2018-09-25 12:10:18taleinatsetmessages: + msg326348
2018-09-25 12:05:16taleinatsetmessages: + msg326347
2018-09-25 11:42:25taleinatsetmessages: + msg326343
2018-09-25 02:01:17terry.reedysetmessages: + msg326310
2018-09-22 17:35:52taleinatsetmessages: + msg326100
2018-08-30 09:36:49taleinatsetmessages: + msg324374
2018-08-30 04:37:57terry.reedysetmessages: + msg324365
2018-08-28 15:00:13taleinatsetmessages: + msg324255
2018-08-16 06:20:33taleinatsettitle: Squeezer - squeeze large output in IDLE -> Squeezer - squeeze large output in IDLE's shell
2018-08-15 22:03:57ppperrysettitle: Squeezer - squeeze large output in the interpreter -> Squeezer - squeeze large output in IDLE
2018-08-13 09:47:28taleinatsetmessages: + msg323471
2018-06-14 05:44:56terry.reedysetmessages: + msg319496
2018-06-14 05:31:00taleinatsetmessages: + msg319495
2018-06-14 05:17:54taleinatsetmessages: + msg319494
2018-06-13 10:51:05cheryl.sabellasetmessages: + msg319452
2018-06-13 06:18:41terry.reedysetmessages: + msg319430
2018-06-13 06:07:12terry.reedysetmessages: + msg319428
2018-06-12 06:58:25taleinatsetmessages: + msg319367
2018-06-12 00:27:24cheryl.sabellasetmessages: + msg319353
2018-06-11 20:51:48terry.reedysetnosy: + cheryl.sabella
messages: + msg319344
2018-06-11 20:16:10terry.reedysetdependencies: + IDLE tooltips.py: refactor and add docstrings and tests
messages: + msg319339
2018-06-11 17:09:37taleinatsetmessages: + msg319319
2018-06-11 16:25:04terry.reedysetmessages: + msg319317
2018-06-11 16:14:28terry.reedysetpriority: low -> normal

nosy: - kbk, ajaksu2, gpolo, roger.serwy
versions: - Python 3.5
messages: + msg319316

assignee: kbk -> terry.reedy
2018-06-11 10:48:25taleinatsetmessages: + msg319291
versions: + Python 3.5, Python 3.6, Python 3.7, Python 3.8, - Python 3.4
2018-06-11 10:43:53taleinatsetstage: needs patch -> patch review
pull_requests: + pull_request7245
2014-02-24 06:39:59taleinatsetfiles: + Squeezer_Screenshot.PNG

messages: + msg212061
2014-02-23 18:52:56taleinatsetmessages: + msg212021
2014-02-19 19:00:27serhiy.storchakasetmessages: + msg211647
2014-02-19 18:54:37taleinatsetmessages: + msg211646
2014-02-19 18:53:35taleinatsetmessages: + msg211645
2014-02-19 18:51:10serhiy.storchakasetmessages: + msg211643
2014-02-12 11:18:16taleinatsetmessages: + msg211083
2014-02-12 10:26:28serhiy.storchakasetmessages: + msg211076
2014-02-12 10:07:22taleinatsetmessages: + msg211075
2014-02-12 09:55:05serhiy.storchakasetmessages: + msg211071
2014-02-12 09:43:47serhiy.storchakasetmessages: + msg211068
2014-02-12 08:56:02taleinatsetnosy: + terry.reedy, roger.serwy
2014-02-11 21:58:22taleinatsetfiles: + taleinat.20140211.IDLE_Squeezer.patch

messages: + msg211027
2014-02-05 13:23:13serhiy.storchakasetmessages: + msg210310
stage: patch review -> needs patch
2014-02-05 10:01:40taleinatsetmessages: + msg210296
2012-10-16 20:43:57serhiy.storchakasetnosy: + serhiy.storchaka

versions: + Python 3.4, - Python 3.2
2010-08-22 01:57:30BreamoreBoysetversions: + Python 3.2, - Python 3.1, Python 2.7
2009-03-30 21:36:31taleinatsetmessages: + msg84657
2009-03-30 20:48:30ajaksu2setnosy: + ajaksu2

messages: + msg84645
stage: test needed -> patch review
2009-03-30 20:24:44taleinatsetmessages: + msg84637
2009-03-30 04:35:33ajaksu2setnosy: + gpolo
versions: + Python 3.1, Python 2.7, - Python 2.6

type: enhancement
stage: test needed
2009-03-21 00:45:51ajaksu2linkissue1442493 dependencies
2008-01-06 12:08:08christian.heimessetassignee: kbk
versions: + Python 2.6
2006-07-27 00:13:56taleinatcreate