Submitted Guilherme Polo's enhancement

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Submitted Guilherme Polo's enhancement

Bruce Sherwood-3
With great help from Tal Einat on the mechanics of how to submit
Guilherme Polo's enhancements, I've presented a diff file to
bugs.python.org against the Python 3.1.2 version of idlelib (tag
r312).

Here's the description:

In December 2008 David Scherer created an alternative version
of IDLE to fix some long-standing problems. In the 2009 Google
Summer of Code Guilherme Polo continued this work, assisted by
Bruce Sherwood. Important new fixes and features include:

 * A configuration preference that permits writing and running
   test programs from the editor without having to save the file
   (you're warned upon quitting whether to save).

 * Bringing the shell window forward in case of an error (because
   novices often failed to realize why their program had stopped).
 * A revert plug-in (FileRevert.py).

 * Unreliable and slow termination of user program on Windows;
   now you can re-run without first closing the graphics window.

 * Missing preferences and other menus on Macintosh.

 * Use any port for RPC server, so multiple instances of VIDLE
   can run at the same time without interference.

Polo submitted patches at the end of the summer of 2009, found at
code.google.com/p/google-summer-of-code-2009-python/downloads/list
This was for the Python 2.X series.

Because the mechanism was not clear for getting these patches
into the version of IDLE distributed with Python, the patched
version has been distributed with VPython (vpython.org) with
the name VIDLE to attempt to avoid confusion with IDLE. It is
installed into site-packages.

In October 2010 Bruce Sherwood manually applied Polo's patches
to the idlelib found at
   svn.python.org/projects/python/tags/r312/Lib/idlelib

In addition to applying Polo's patches, the new code uses the new
dot addressing of modules (e.g. from . import PyShell). Except for
having to change one absolute address in the use of __import__ in
PyShell.py, this version can work either in Python31/Lib/idlelib or
in Python31/Lib/site-packages/vidle. This VIDLE will be included in
the installer for VPython for Python 3.
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Guido van Rossum
Hi Bruce,

Thanks very much you for your perseverance. It sounds like the money
on the GSOC student was well spent. Thanks also for observing novices
and fixing the issues that cause them the most pain! Hopefully someone
will review and commit the patches soon!

--Guido

On Tue, Oct 12, 2010 at 8:24 PM, Bruce Sherwood <[hidden email]> wrote:

> With great help from Tal Einat on the mechanics of how to submit
> Guilherme Polo's enhancements, I've presented a diff file to
> bugs.python.org against the Python 3.1.2 version of idlelib (tag
> r312).
>
> Here's the description:
>
> In December 2008 David Scherer created an alternative version
> of IDLE to fix some long-standing problems. In the 2009 Google
> Summer of Code Guilherme Polo continued this work, assisted by
> Bruce Sherwood. Important new fixes and features include:
>
>  * A configuration preference that permits writing and running
>   test programs from the editor without having to save the file
>   (you're warned upon quitting whether to save).
>
>  * Bringing the shell window forward in case of an error (because
>   novices often failed to realize why their program had stopped).
>  * A revert plug-in (FileRevert.py).
>
>  * Unreliable and slow termination of user program on Windows;
>   now you can re-run without first closing the graphics window.
>
>  * Missing preferences and other menus on Macintosh.
>
>  * Use any port for RPC server, so multiple instances of VIDLE
>   can run at the same time without interference.
>
> Polo submitted patches at the end of the summer of 2009, found at
> code.google.com/p/google-summer-of-code-2009-python/downloads/list
> This was for the Python 2.X series.
>
> Because the mechanism was not clear for getting these patches
> into the version of IDLE distributed with Python, the patched
> version has been distributed with VPython (vpython.org) with
> the name VIDLE to attempt to avoid confusion with IDLE. It is
> installed into site-packages.
>
> In October 2010 Bruce Sherwood manually applied Polo's patches
> to the idlelib found at
>   svn.python.org/projects/python/tags/r312/Lib/idlelib
>
> In addition to applying Polo's patches, the new code uses the new
> dot addressing of modules (e.g. from . import PyShell). Except for
> having to change one absolute address in the use of __import__ in
> PyShell.py, this version can work either in Python31/Lib/idlelib or
> in Python31/Lib/site-packages/vidle. This VIDLE will be included in
> the installer for VPython for Python 3.
> _______________________________________________
> IDLE-dev mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/idle-dev
>



--
--Guido van Rossum (python.org/~guido)
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Tal Einat
I've got some free time on my hands and I now have permission to make
commits for IDLE, so I'll take a look at it today.

- Tal

On Wed, Oct 13, 2010 at 5:27 AM, Guido van Rossum <[hidden email]> wrote:

> Hi Bruce,
>
> Thanks very much you for your perseverance. It sounds like the money
> on the GSOC student was well spent. Thanks also for observing novices
> and fixing the issues that cause them the most pain! Hopefully someone
> will review and commit the patches soon!
>
> --Guido
>
> On Tue, Oct 12, 2010 at 8:24 PM, Bruce Sherwood <[hidden email]> wrote:
>> With great help from Tal Einat on the mechanics of how to submit
>> Guilherme Polo's enhancements, I've presented a diff file to
>> bugs.python.org against the Python 3.1.2 version of idlelib (tag
>> r312).
>>
>> Here's the description:
>>
>> In December 2008 David Scherer created an alternative version
>> of IDLE to fix some long-standing problems. In the 2009 Google
>> Summer of Code Guilherme Polo continued this work, assisted by
>> Bruce Sherwood. Important new fixes and features include:
>>
>>  * A configuration preference that permits writing and running
>>   test programs from the editor without having to save the file
>>   (you're warned upon quitting whether to save).
>>
>>  * Bringing the shell window forward in case of an error (because
>>   novices often failed to realize why their program had stopped).
>>  * A revert plug-in (FileRevert.py).
>>
>>  * Unreliable and slow termination of user program on Windows;
>>   now you can re-run without first closing the graphics window.
>>
>>  * Missing preferences and other menus on Macintosh.
>>
>>  * Use any port for RPC server, so multiple instances of VIDLE
>>   can run at the same time without interference.
>>
>> Polo submitted patches at the end of the summer of 2009, found at
>> code.google.com/p/google-summer-of-code-2009-python/downloads/list
>> This was for the Python 2.X series.
>>
>> Because the mechanism was not clear for getting these patches
>> into the version of IDLE distributed with Python, the patched
>> version has been distributed with VPython (vpython.org) with
>> the name VIDLE to attempt to avoid confusion with IDLE. It is
>> installed into site-packages.
>>
>> In October 2010 Bruce Sherwood manually applied Polo's patches
>> to the idlelib found at
>>   svn.python.org/projects/python/tags/r312/Lib/idlelib
>>
>> In addition to applying Polo's patches, the new code uses the new
>> dot addressing of modules (e.g. from . import PyShell). Except for
>> having to change one absolute address in the use of __import__ in
>> PyShell.py, this version can work either in Python31/Lib/idlelib or
>> in Python31/Lib/site-packages/vidle. This VIDLE will be included in
>> the installer for VPython for Python 3.
>> _______________________________________________
>> IDLE-dev mailing list
>> [hidden email]
>> http://mail.python.org/mailman/listinfo/idle-dev
>>
>
>
>
> --
> --Guido van Rossum (python.org/~guido)
> _______________________________________________
> IDLE-dev mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/idle-dev
>
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Ned Deily
In reply to this post by Bruce Sherwood-3
In article
<AANLkTimqCTK2op+ZA4vqMQqW+Z32mkf7ztp=[hidden email]>,
 Bruce Sherwood <[hidden email]> wrote:
> With great help from Tal Einat on the mechanics of how to submit
> Guilherme Polo's enhancements, I've presented a diff file to
> bugs.python.org against the Python 3.1.2 version of idlelib (tag
> r312).

Thanks for getting the changes submitted!

BTW, I was looking into some other issues with IDLE on OS X and was
interested to see whether these enhancements would have any effect on
what I was seeing.  Normally, at this stage, new features would only be
checked into the py3k branch (the main development branch) of the python
source trees (rather than the 3.1.x branch which is generally only
accepting bug fixes) so I decided to do a quick forward port of the
patch to py3k.  I've uploaded that patch to the issue tracker.  As I
noted there, I found that it had no affect on the other issues so I'm
not planning to do any more work on the ported patch but it might be of
some use as a head start on the py3k port.

http://bugs.python.org/issue10079

--
 Ned Deily,
 [hidden email]

_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Bruce Sherwood-3
Thanks for catching the missing utils.py file. I can explain the
missing/commented statement in IOBinding.py. I found experimentally
that if that statement is present, when you open a file on Windows the
first line is off the top of the display, which can be quite
confusing; this bug is not present on the Mac, and deleting the
statement makes Windows work properly without affecting the Mac. The
deletion of the statement was the very last correction Guilherme Polo
made, and I got the correction into the patch I submitted but not into
an earlier file at vpython.org.

Since you've expressed interest in the Mac, I'll post here some
comments I sent to Tal Einat this evening:

I've found a bug (or maybe it's two bugs) in IDLE, which also affects
VIDLE (shorthand for IDLE with my diffs applied).

On Windows, using the command line, cd to the idlelib directory, then
execute c:\Python31\python idle.pyw. Create a new edit window (if
there isn't one already) and enter some text, but don't save. Press
ctrl-Q to quit, and you're asked whether you want to save the file.
Say yes, and deliberately overwrite an existing file. The file gets
saved, and Python exits, but you'll see in the command line window an
error in Multicall.py, line 221; trying to remove a func from a list
of funcs. If you put print statements in Multicall to debug the
problem you'll find that the func isn't in the list because it's
memory address doesn't match. In a way, one could say that it doesn't
matter, because the file does get saved, it's just that the exit isn't
graceful. But it's worrisome.

On Mac, the situation is worse, in that when you press cmd-Q to quit,
and you have unsaved changes, Python just quits without asking you
whether to save the file. This happens whether you're working with an
as-yet unsaved file or a saved file to which you've added some text.

Again, I emphasize that these are problems of IDLE, not just VIDLE.
I'm telling you this rather than filing a bug report at this time on
the chance that with your knowledge of IDLE you'll see the problem and
fix it in the process of trying out VIDLE. Obviously the Mac problem
is quite serious, because you can lose work.

Here's another piece of information. On Windows, running from the
command line, if I click the window close button I don't get the
error, only if I hit ctrl-Q.

I'm trying to trace where cmd-Q goes on the Mac and so far I've failed
to find it. In particular, neither the close routines in EditorWindow
(which are driven by clicking the close box on a window)m nor
close_all_callback in FileListm are driven by cmd-Q.

So I'm puzzled; cmd-Q does quit Python but I haven't figured out how.
Evidently it's taking a branch that does no checks for needing to save
a file.

Bruce

On Wed, Oct 13, 2010 at 11:51 PM, Ned Deily <[hidden email]> wrote:

> In article
> <AANLkTimqCTK2op+ZA4vqMQqW+Z32mkf7ztp=[hidden email]>,
>  Bruce Sherwood <[hidden email]> wrote:
>> With great help from Tal Einat on the mechanics of how to submit
>> Guilherme Polo's enhancements, I've presented a diff file to
>> bugs.python.org against the Python 3.1.2 version of idlelib (tag
>> r312).
>
> Thanks for getting the changes submitted!
>
> BTW, I was looking into some other issues with IDLE on OS X and was
> interested to see whether these enhancements would have any effect on
> what I was seeing.  Normally, at this stage, new features would only be
> checked into the py3k branch (the main development branch) of the python
> source trees (rather than the 3.1.x branch which is generally only
> accepting bug fixes) so I decided to do a quick forward port of the
> patch to py3k.  I've uploaded that patch to the issue tracker.  As I
> noted there, I found that it had no affect on the other issues so I'm
> not planning to do any more work on the ported patch but it might be of
> some use as a head start on the py3k port.
>
> http://bugs.python.org/issue10079
>
> --
>  Ned Deily,
>  [hidden email]
>
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Guido van Rossum
In reply to this post by Ned Deily
Is there any chance of getting these changes into 2.7 as well? There
will be bugfix updates for 2.7, and David Beazley just tweeted about
how the IDLE experience with Python 2.7 got much worse compared to
2.6.

--
--Guido van Rossum (python.org/~guido)
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Bruce Sherwood-3
I will submit an appropriate patch for 2.7; vidle was used with 2.6
and 2.7 since summer 2009. There were indeed a variety of problems
with idlelib on Python 2 that the temporary fix of vidle addressed. I
wasn't aware that things got worse from 2.6 to 2.7, because I only
used vidle with these Pythons.

I need to check whether the Mac failure to save changes upon pressing
cmd-Q was present in 2.7 as well as 3.

Bruce Sherwood

On Thu, Oct 14, 2010 at 8:57 AM, Guido van Rossum <[hidden email]> wrote:

> Is there any chance of getting these changes into 2.7 as well? There
> will be bugfix updates for 2.7, and David Beazley just tweeted about
> how the IDLE experience with Python 2.7 got much worse compared to
> 2.6.
>
> --
> --Guido van Rossum (python.org/~guido)
> _______________________________________________
> IDLE-dev mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/idle-dev
>
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Bruce Sherwood-3
Yup. Using IDLE on Python 2.7 on a Mac, cmd-Q (or the corresponding
menu option, for that matter), there is no prompt to save unsaved
files. I hope someone more knowledgeable than me about IDLE can find
the problem, or maybe just suggest where I should look. I'll keep
looking, but as I said, I'm baffled that I can't even identify what
code gets executed upon pressing cmd-Q.

I'll go ahead and prepare a patch for idle for Python 2.7 right away
that won't have a fix for this serious save problem. The save issue
can be considered separately.

Bruce Sherwood

On Thu, Oct 14, 2010 at 9:22 AM, Bruce Sherwood <[hidden email]> wrote:

> I will submit an appropriate patch for 2.7; vidle was used with 2.6
> and 2.7 since summer 2009. There were indeed a variety of problems
> with idlelib on Python 2 that the temporary fix of vidle addressed. I
> wasn't aware that things got worse from 2.6 to 2.7, because I only
> used vidle with these Pythons.
>
> I need to check whether the Mac failure to save changes upon pressing
> cmd-Q was present in 2.7 as well as 3.
>
> Bruce Sherwood
>
> On Thu, Oct 14, 2010 at 8:57 AM, Guido van Rossum <[hidden email]> wrote:
>> Is there any chance of getting these changes into 2.7 as well? There
>> will be bugfix updates for 2.7, and David Beazley just tweeted about
>> how the IDLE experience with Python 2.7 got much worse compared to
>> 2.6.
>>
>> --
>> --Guido van Rossum (python.org/~guido)
>> _______________________________________________
>> IDLE-dev mailing list
>> [hidden email]
>> http://mail.python.org/mailman/listinfo/idle-dev
>>
>
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Ned Deily
In reply to this post by Guido van Rossum
In article
<[hidden email]>,
 Guido van Rossum <[hidden email]> wrote:
> Is there any chance of getting these changes into 2.7 as well? There
> will be bugfix updates for 2.7, and David Beazley just tweeted about
> how the IDLE experience with Python 2.7 got much worse compared to
> 2.6.

In his tweet he is referring to Python 2.7 on OS X.  Perhaps he's
running into the problem documented in http://bugs.python.org/issue9227 
which is that the IDLE in the new-style 64-bit/32-bit python.org
installer variant  ("10.5+") is broken on 10.6.  The workaround is to
use the other ("10.3+", 32-bit only) OS X installer for 2.7.  The
changes here aren't fixing bugs on OS X and I'm not aware of any other
IDLE OS X regressions between 2.6 and 2.7.   If there are, I hope
someone opens issues for them.

--
 Ned Deily,
 [hidden email]

_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Ned Deily
In reply to this post by Bruce Sherwood-3
In article
<[hidden email]>,
 Bruce Sherwood <[hidden email]> wrote:

> Yup. Using IDLE on Python 2.7 on a Mac, cmd-Q (or the corresponding
> menu option, for that matter), there is no prompt to save unsaved
> files. I hope someone more knowledgeable than me about IDLE can find
> the problem, or maybe just suggest where I should look. I'll keep
> looking, but as I said, I'm baffled that I can't even identify what
> code gets executed upon pressing cmd-Q.
>
> I'll go ahead and prepare a patch for idle for Python 2.7 right away
> that won't have a fix for this serious save problem. The save issue
> can be considered separately.

If I understand correctly, quitting without prompting for unsaved files
is not a new problem with 2.7; I see the same behavior with 2.6.  It
would be best, I think, to open an issue on the bug tracker for that
problem and any other new specific problems.

--
 Ned Deily,
 [hidden email]

_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Bruce Sherwood-3
In reply to this post by Ned Deily
At Ned Deily's suggestion I've posted the following to bugs.python.org:

It has just been discovered that at least since Python 2.6 on the Mac,
quitting IDLE does not prompt to save unsaved code, which is then
lost. The recently submitted diff for bringing Guilherme Polo's Google
Summer of Code improvements into IDLE on Python 3 (ID 10079) does not
fix the problem.

Bruce Sherwood
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Terry Reedy
In reply to this post by Guido van Rossum
On 10/14/2010 10:57 AM, Guido van Rossum wrote:
> Is there any chance of getting these changes into 2.7 as well? There
> will be bugfix updates for 2.7, and David Beazley just tweeted about
> how the IDLE experience with Python 2.7 got much worse compared to
> 2.6.

If there are new features in the patch, it would violate the 'no new
features in bugfixes' policy. On the other hand, since IDLE is used
interactively rather than in programs, I do not think the reason for the
policy applies as strongly as to everything else in the stdlib.

Bruce, if you post a 2.7 patch with new features, please quote Guido's
request so that tracker gardeners will know that it has BDFL approval in
that regard.

--
Terry Jan Reedy

_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Bruce Sherwood-3
Ned Deily's note (repeated here) made me think that I should not
submit a patch for 2.7 because he has reason to believe that the
problems aren't with IDLE.

Bruce Sherwood

----------------------------------------

In article
<[hidden email]>,
 Guido van Rossum <[hidden email]> wrote:
> Is there any chance of getting these changes into 2.7 as well? There
> will be bugfix updates for 2.7, and David Beazley just tweeted about
> how the IDLE experience with Python 2.7 got much worse compared to
> 2.6.

In his tweet he is referring to Python 2.7 on OS X.  Perhaps he's
running into the problem documented in http://bugs.python.org/issue9227
which is that the IDLE in the new-style 64-bit/32-bit python.org
installer variant  ("10.5+") is broken on 10.6.  The workaround is to
use the other ("10.3+", 32-bit only) OS X installer for 2.7.  The
changes here aren't fixing bugs on OS X and I'm not aware of any other
IDLE OS X regressions between 2.6 and 2.7.   If there are, I hope
someone opens issues for them.

--
 Ned Deily,
 [hidden email]

On Thu, Oct 14, 2010 at 9:29 PM, Terry Reedy <[hidden email]> wrote:

> On 10/14/2010 10:57 AM, Guido van Rossum wrote:
>>
>> Is there any chance of getting these changes into 2.7 as well? There
>> will be bugfix updates for 2.7, and David Beazley just tweeted about
>> how the IDLE experience with Python 2.7 got much worse compared to
>> 2.6.
>
> If there are new features in the patch, it would violate the 'no new
> features in bugfixes' policy. On the other hand, since IDLE is used
> interactively rather than in programs, I do not think the reason for the
> policy applies as strongly as to everything else in the stdlib.
>
> Bruce, if you post a 2.7 patch with new features, please quote Guido's
> request so that tracker gardeners will know that it has BDFL approval in
> that regard.
>
> --
> Terry Jan Reedy
>
> _______________________________________________
> IDLE-dev mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/idle-dev
>
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Bruce Sherwood-3
In reply to this post by Tal Einat
I'm trying to find out why when you quit on the Mac unsaved changes
don't trigger an invitation to save the file. Instead, IDLE quits and
you lose your edits.

There is code to bind cmd-q to the edit window and, on the Mac, to the
Tk root, through macosxSupport.setupApp which calls macosxSupport
overrideRootMenu. I've tried printing something in the callback
routine (FileList.close_all_callback), and I don't see the print. I've
tried commenting out one or both of these bindings, and I can still
quit with cmd-q. I've looked a bit at the tkinter code. I'm beginning
to have the sinking feeling that there's something in the library
_tkinter.so itself that is swallowing cmd-q and not sending it to
tkinter, so it doesn't get to IDLE. I have the vague notion that there
have been some problems with tkinter on the Mac, but I don't know any
details....?

Is there someone who reads this idle-dev list who knows enough about
_tkinter.so on the Mac to be able to say whether this could be the
problem? If _tkinter.so doesn't pass through to IDLE a cmd-q event (or
the equivalent menu choice to quit), there's nothing we can do to make
IDLE work properly on the Mac without changes to _tkinter.so. I don't
feel competent to design a clean simple tkinter test to prove the
point and post a bug report.

Of course I could be missing something somehow, but on Windows if I
put a print statement in the callback routine I see that text when I
press ctrl-q.

Bruce Sherwood
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Ned Deily
In article
<AANLkTin10Qq3VZiJ=[hidden email]>,
 Bruce Sherwood <[hidden email]> wrote:

> I'm trying to find out why when you quit on the Mac unsaved changes
> don't trigger an invitation to save the file. Instead, IDLE quits and
> you lose your edits.
>
> There is code to bind cmd-q to the edit window and, on the Mac, to the
> Tk root, through macosxSupport.setupApp which calls macosxSupport
> overrideRootMenu. I've tried printing something in the callback
> routine (FileList.close_all_callback), and I don't see the print. I've
> tried commenting out one or both of these bindings, and I can still
> quit with cmd-q. I've looked a bit at the tkinter code. I'm beginning
> to have the sinking feeling that there's something in the library
> _tkinter.so itself that is swallowing cmd-q and not sending it to
> tkinter, so it doesn't get to IDLE. I have the vague notion that there
> have been some problems with tkinter on the Mac, but I don't know any
> details....?

Working on it.  The problem is due to the fact that the standard Aqua Tk
on OS X is itself an official OS X app and creates the menu bar with
default menu options including a standard application Quit.   I think I
see how to intercept that.

I suggest we move the discussion to the bug tracker
(http://bugs.python.org/issue10107).

--
 Ned Deily,
 [hidden email]

_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Ned Deily
In reply to this post by Bruce Sherwood-3
In article
<[hidden email]>,
 Bruce Sherwood <[hidden email]> wrote:

> Ned Deily's note (repeated here) made me think that I should not
> submit a patch for 2.7 because he has reason to believe that the
> problems aren't with IDLE.

I think the question of whether Guilherme's enhancements should go into
2.7 is independent of the "quit" problem, which I was unaware of until
it was brought by here earlier today.  I agree with Terry's comment
regarding 2.7; if you are willing to make a 2.7 patch, my vote would be
to submit it.  And if there are other bugs that people know of, it would
be more helpful to open bug tracker issues for them rather than tweeting
about them.

--
 Ned Deily,
 [hidden email]

_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Bruce Sherwood-3
In reply to this post by Ned Deily
I'm relieved to hear that you may have a way to override. Yes, let's
continue the discussion in the bug report context.

Bruce Sherwood

On Thu, Oct 14, 2010 at 11:14 PM, Ned Deily <[hidden email]> wrote:

> In article
> <AANLkTin10Qq3VZiJ=[hidden email]>,
>  Bruce Sherwood <[hidden email]> wrote:
>
>> I'm trying to find out why when you quit on the Mac unsaved changes
>> don't trigger an invitation to save the file. Instead, IDLE quits and
>> you lose your edits.
>>
>> There is code to bind cmd-q to the edit window and, on the Mac, to the
>> Tk root, through macosxSupport.setupApp which calls macosxSupport
>> overrideRootMenu. I've tried printing something in the callback
>> routine (FileList.close_all_callback), and I don't see the print. I've
>> tried commenting out one or both of these bindings, and I can still
>> quit with cmd-q. I've looked a bit at the tkinter code. I'm beginning
>> to have the sinking feeling that there's something in the library
>> _tkinter.so itself that is swallowing cmd-q and not sending it to
>> tkinter, so it doesn't get to IDLE. I have the vague notion that there
>> have been some problems with tkinter on the Mac, but I don't know any
>> details....?
>
> Working on it.  The problem is due to the fact that the standard Aqua Tk
> on OS X is itself an official OS X app and creates the menu bar with
> default menu options including a standard application Quit.   I think I
> see how to intercept that.
>
> I suggest we move the discussion to the bug tracker
> (http://bugs.python.org/issue10107).
>
> --
>  Ned Deily,
>  [hidden email]
>
> _______________________________________________
> IDLE-dev mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/idle-dev
>
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Bruce Sherwood-3
In reply to this post by Ned Deily
I'm quite happy to prepare a patch for 2.7; one possibility is to make
a diff from the 2.7 version of vidle. I guess I misinterpreted your
comments about 32/64 etc. I'll be out of touch for the next couple
days. I'm really excited about a two-day visit to Zuni Pueblo (New
Mexico).

Bruce Sherwood

On Thu, Oct 14, 2010 at 11:21 PM, Ned Deily <[hidden email]> wrote:

> In article
> <[hidden email]>,
>  Bruce Sherwood <[hidden email]> wrote:
>
>> Ned Deily's note (repeated here) made me think that I should not
>> submit a patch for 2.7 because he has reason to believe that the
>> problems aren't with IDLE.
>
> I think the question of whether Guilherme's enhancements should go into
> 2.7 is independent of the "quit" problem, which I was unaware of until
> it was brought by here earlier today.  I agree with Terry's comment
> regarding 2.7; if you are willing to make a 2.7 patch, my vote would be
> to submit it.  And if there are other bugs that people know of, it would
> be more helpful to open bug tracker issues for them rather than tweeting
> about them.
>
> --
>  Ned Deily,
>  [hidden email]
>
> _______________________________________________
> IDLE-dev mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/idle-dev
>
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Kevin Walzer-5
In reply to this post by Bruce Sherwood-3
On 10/15/10 12:25 AM, Bruce Sherwood wrote:

> I'm trying to find out why when you quit on the Mac unsaved changes
> don't trigger an invitation to save the file. Instead, IDLE quits and
> you lose your edits.
>
> There is code to bind cmd-q to the edit window and, on the Mac, to the
> Tk root, through macosxSupport.setupApp which calls macosxSupport
> overrideRootMenu. I've tried printing something in the callback
> routine (FileList.close_all_callback), and I don't see the print. I've
> tried commenting out one or both of these bindings, and I can still
> quit with cmd-q. I've looked a bit at the tkinter code. I'm beginning
> to have the sinking feeling that there's something in the library
> _tkinter.so itself that is swallowing cmd-q and not sending it to
> tkinter, so it doesn't get to IDLE. I have the vague notion that there
> have been some problems with tkinter on the Mac, but I don't know any
> details....?
>
> Is there someone who reads this idle-dev list who knows enough about
> _tkinter.so on the Mac to be able to say whether this could be the
> problem? If _tkinter.so doesn't pass through to IDLE a cmd-q event (or
> the equivalent menu choice to quit), there's nothing we can do to make
> IDLE work properly on the Mac without changes to _tkinter.so. I don't
> feel competent to design a clean simple tkinter test to prove the
> point and post a bug report.


Tk on the Mac has a built in command called ::tk::mac::Quit, which
corresponds to the "quit" Apple event. If this command is not defined,
then I believe the default behavior for Tk on the Mac is to quit (when
accessed from the menu--not sure about Command-Q). I think the right way
to manage this in IDLE would be to do something like this:

root.createcommand('::tk::mac::Quit', <insert IDLE's shutdown function
here>)

This will map whatever function IDLE calls to prompt the user to save
data before closing, to the Apple quit event.

(Sorry I don't have time to submit a patch, but hopefully this can point
someone in the right direction.)

--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Submitted Guilherme Polo's enhancement

Bruce Sherwood-3
The following statement is executed in macosxSupport.py, which I
assume was an attempt to override, but it's unsuccessful:

root.bind('<<close-all-windows>>', flist.close_all_callback)

Bruce Sherwood

On Fri, Oct 15, 2010 at 6:17 AM, Kevin Walzer <[hidden email]> wrote:

>
> Tk on the Mac has a built in command called ::tk::mac::Quit, which
> corresponds to the "quit" Apple event. If this command is not defined, then
> I believe the default behavior for Tk on the Mac is to quit (when accessed
> from the menu--not sure about Command-Q). I think the right way to manage
> this in IDLE would be to do something like this:
>
> root.createcommand('::tk::mac::Quit', <insert IDLE's shutdown function
> here>)
>
> This will map whatever function IDLE calls to prompt the user to save data
> before closing, to the Apple quit event.
>
> (Sorry I don't have time to submit a patch, but hopefully this can point
> someone in the right direction.)
>
> --Kevin
>
> --
> Kevin Walzer
> Code by Kevin
> http://www.codebykevin.com
> _______________________________________________
> IDLE-dev mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/idle-dev
>
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
12