[issue27239] Make idlelib.macosx self-contained.

2019-03-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +IDLE
nosy:  -python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27239] Make idlelib.macosx self-contained.

2016-06-12 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Remove the now unneeded call in htest to _init_tk_type.  It was tempting to 
leave the call for the 'efficiency' of the direct call with the available root, 
but there is a mental efficiency in removing it and making _init_tk_type 
completely an internal implementation detail of macosx.

Remove the unneeded call in macosx.setupApp.  This makes the _init_tk_type 
local to its section of the module.  It also allows a test to set _tk_type to 
simulate being on a particular type of Mac and call setupApp without having the 
setting overwritten by the real value. Test_macosx now calls setupApp with each 
_tk_type set to each possible non-None value.

The same objective could have been met by conditioning the call with 'if 
_tk_type is  None:', but removing the call means that _init_tk_type is no 
longer ever called with a root, so the parameter can be removed and the 
function simplified.  This section of macosx now takes care of initializing 
itself and the rest of IDLE can simply call the isTypeTk functions without 
worrying about initialization.

Have macosx call its test when run as main.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27239] Make idlelib.macosx self-contained.

2016-06-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d8a2b6efdd4a by Terry Jan Reedy in branch 'default':
Issue #27239: Continue refactoring idlelib.macosx and adding macosx tests.
https://hg.python.org/cpython/rev/d8a2b6efdd4a

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27239] Make idlelib.macosx self-contained.

2016-06-09 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27239] Make idlelib.macosx self-contained.

2016-06-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I ran into this issue again with the test I am writing for another issue, so I 
pushed it as is, after testing.

Ned, neither of the working OSX buildbots run gui tests.  I am presuming that 
you run the test suite occasionally and will notice if test_idle fails.

Serhiy, almost ditto, except for Zach Ware's Gentoo bot.  What do you think of 
initializing, using a temporary Tk(), during import?  Or best to leave as is?

--
resolution:  -> fixed
stage: patch review -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27239] Make idlelib.macosx self-contained.

2016-06-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cc7f63b6847e by Terry Jan Reedy in branch 'default':
Issue #27239: idlelib.macosx.isXyzTk functions initialize as needed.
https://hg.python.org/cpython/rev/cc7f63b6847e

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27239] Make idlelib.macosx self-contained.

2016-06-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Here is a post-import patch with tests.

--
keywords: +patch
stage: test needed -> patch review
Added file: http://bugs.python.org/file43266/macosx-contained.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27239] Make idlelib.macosx self-contained.

2016-06-05 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Lib/idlelib/macosx.py:8 initializes _tk_type to None.  It next defines private 
function _initializeTkVariantTests, which in called in setupApp and which 
initializes _tk_type.  Then follow 4 isXyzTk functins, which "assert _tk_type 
is not None".  This is fine for IDLE because IDLE call setupApp on startup.

This is not fine for testing.  In general, tests do not and should not call 
setupApp. If a test happens to exercise one of the 11 (for now) isXyzTk calls 
occurring outside of macosx, the assert is triggered.  The test writer must 
then discover to import and call the supposedly private 
_initializeTkVariantTests.

I would prefer instead that maxosx be more self-contained, and initialize 
_tk_type as needed.  _initializeTkVariantTests needs a Tk instance for this 
line.
ws = root.tk.call('tk', 'windowingsystem')
I would like to wrap that with root = tkinter.Tk() and root.destroy.  If that 
cannot be done on import, then instead of deleting the asserts, replace them 
with conditional calls to the initialization function.

--
assignee: terry.reedy
messages: 267513
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: Make idlelib.macosx self-contained.
type: behavior
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com