mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	bpo-35213: Where appropriate, use 'macOS' in idlelib. (#10478)
This commit is contained in:
		
							parent
							
								
									70f61b933f
								
							
						
					
					
						commit
						b65413b497
					
				
					 6 changed files with 28 additions and 28 deletions
				
			
		|  | @ -20,7 +20,7 @@ IDLE has the following features: | ||||||
| 
 | 
 | ||||||
| * coded in 100% pure Python, using the :mod:`tkinter` GUI toolkit | * coded in 100% pure Python, using the :mod:`tkinter` GUI toolkit | ||||||
| 
 | 
 | ||||||
| * cross-platform: works mostly the same on Windows, Unix, and Mac OS X | * cross-platform: works mostly the same on Windows, Unix, and macOS | ||||||
| 
 | 
 | ||||||
| * Python shell window (interactive interpreter) with colorizing | * Python shell window (interactive interpreter) with colorizing | ||||||
|   of code input, output, and error messages |   of code input, output, and error messages | ||||||
|  | @ -48,7 +48,7 @@ Output windows, such as used for Edit => Find in Files, are a subtype of editor | ||||||
| window.  They currently have the same top menu but a different | window.  They currently have the same top menu but a different | ||||||
| default title and context menu. | default title and context menu. | ||||||
| 
 | 
 | ||||||
| On MacOS, there is one application menu.  It dynamically changes according | On macOS, there is one application menu.  It dynamically changes according | ||||||
| to the window currently selected.  It has an IDLE menu, and some entries | to the window currently selected.  It has an IDLE menu, and some entries | ||||||
| described below are moved around to conform to Apple guidlines. | described below are moved around to conform to Apple guidlines. | ||||||
| 
 | 
 | ||||||
|  | @ -267,7 +267,7 @@ Options menu (Shell and Editor) | ||||||
| Configure IDLE | Configure IDLE | ||||||
|    Open a configuration dialog and change preferences for the following: |    Open a configuration dialog and change preferences for the following: | ||||||
|    fonts, indentation, keybindings, text color themes, startup windows and |    fonts, indentation, keybindings, text color themes, startup windows and | ||||||
|    size, additional help sources, and extensions (see below).  On OS X, |    size, additional help sources, and extensions (see below).  On macOS, | ||||||
|    open the configuration dialog by selecting Preferences in the application |    open the configuration dialog by selecting Preferences in the application | ||||||
|    menu.  To use a new built-in color theme (IDLE Dark) with older IDLEs, |    menu.  To use a new built-in color theme (IDLE Dark) with older IDLEs, | ||||||
|    save it as a new custom theme. |    save it as a new custom theme. | ||||||
|  | @ -324,7 +324,7 @@ on Help menu choices. | ||||||
| Context Menus | Context Menus | ||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||||||
| 
 | 
 | ||||||
| Open a context menu by right-clicking in a window (Control-click on OS X). | Open a context menu by right-clicking in a window (Control-click on macOS). | ||||||
| Context menus have the standard clipboard functions also on the Edit menu. | Context menus have the standard clipboard functions also on the Edit menu. | ||||||
| 
 | 
 | ||||||
| Cut | Cut | ||||||
|  | @ -381,7 +381,7 @@ Key bindings | ||||||
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^ | ||||||
| 
 | 
 | ||||||
| In this section, 'C' refers to the :kbd:`Control` key on Windows and Unix and | In this section, 'C' refers to the :kbd:`Control` key on Windows and Unix and | ||||||
| the :kbd:`Command` key on Mac OSX. | the :kbd:`Command` key on macOS. | ||||||
| 
 | 
 | ||||||
| * :kbd:`Backspace` deletes to the left; :kbd:`Del` deletes to the right | * :kbd:`Backspace` deletes to the left; :kbd:`Del` deletes to the right | ||||||
| 
 | 
 | ||||||
|  | @ -526,9 +526,9 @@ code interactively.  IDLE's Shell window also responds to the following keys. | ||||||
|   Command history |   Command history | ||||||
| 
 | 
 | ||||||
|   * :kbd:`Alt-p` retrieves previous command matching what you have typed. On |   * :kbd:`Alt-p` retrieves previous command matching what you have typed. On | ||||||
|     OS X use :kbd:`C-p`. |     macOS use :kbd:`C-p`. | ||||||
| 
 | 
 | ||||||
|   * :kbd:`Alt-n` retrieves next. On OS X use :kbd:`C-n`. |   * :kbd:`Alt-n` retrieves next. On macOS use :kbd:`C-n`. | ||||||
| 
 | 
 | ||||||
|   * :kbd:`Return` while on any previous command retrieves that command |   * :kbd:`Return` while on any previous command retrieves that command | ||||||
| 
 | 
 | ||||||
|  | @ -796,7 +796,7 @@ changed via Configure IDLE on the Option menu.  Keys can be user defined; | ||||||
| IDLE ships with four built-in key sets. In addition, a user can create a | IDLE ships with four built-in key sets. In addition, a user can create a | ||||||
| custom key set in the Configure IDLE dialog under the keys tab. | custom key set in the Configure IDLE dialog under the keys tab. | ||||||
| 
 | 
 | ||||||
| IDLE on MacOS | IDLE on macOS | ||||||
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^ | ||||||
| 
 | 
 | ||||||
| Under System Preferences: Dock, one can set "Prefer tabs when opening | Under System Preferences: Dock, one can set "Prefer tabs when opening | ||||||
|  |  | ||||||
|  | @ -562,12 +562,11 @@ def GetCurrentKeySet(self): | ||||||
|         result = self.GetKeySet(self.CurrentKeys()) |         result = self.GetKeySet(self.CurrentKeys()) | ||||||
| 
 | 
 | ||||||
|         if sys.platform == "darwin": |         if sys.platform == "darwin": | ||||||
|             # OS X Tk variants do not support the "Alt" keyboard modifier. |             # macOS (OS X) Tk variants do not support the "Alt" | ||||||
|             # So replace all keybingings that use "Alt" with ones that |             # keyboard modifier.  Replace it with "Option". | ||||||
|             # use the "Option" keyboard modifier. |             # TODO (Ned?): the "Option" modifier does not work properly | ||||||
|             # TODO (Ned?): the "Option" modifier does not work properly for |             #     for Cocoa Tk and XQuartz Tk so we should not use it | ||||||
|             #        Cocoa Tk and XQuartz Tk so we should not use it |             #     in the default 'OSX' keyset. | ||||||
|             #        in default OS X KeySets. |  | ||||||
|             for k, v in result.items(): |             for k, v in result.items(): | ||||||
|                 v2 = [ x.replace('<Alt-', '<Option-') for x in v ] |                 v2 = [ x.replace('<Alt-', '<Option-') for x in v ] | ||||||
|                 if v != v2: |                 if v != v2: | ||||||
|  |  | ||||||
|  | @ -108,7 +108,7 @@ <h3>Navigation</h3> | ||||||
| <p>IDLE has the following features:</p> | <p>IDLE has the following features:</p> | ||||||
| <ul class="simple"> | <ul class="simple"> | ||||||
| <li>coded in 100% pure Python, using the <a class="reference internal" href="tkinter.html#module-tkinter" title="tkinter: Interface to Tcl/Tk for graphical user interfaces"><code class="xref py py-mod docutils literal notranslate"><span class="pre">tkinter</span></code></a> GUI toolkit</li> | <li>coded in 100% pure Python, using the <a class="reference internal" href="tkinter.html#module-tkinter" title="tkinter: Interface to Tcl/Tk for graphical user interfaces"><code class="xref py py-mod docutils literal notranslate"><span class="pre">tkinter</span></code></a> GUI toolkit</li> | ||||||
| <li>cross-platform: works mostly the same on Windows, Unix, and Mac OS X</li> | <li>cross-platform: works mostly the same on Windows, Unix, and macOS</li> | ||||||
| <li>Python shell window (interactive interpreter) with colorizing | <li>Python shell window (interactive interpreter) with colorizing | ||||||
| of code input, output, and error messages</li> | of code input, output, and error messages</li> | ||||||
| <li>multi-window text editor with multiple undo, Python colorizing, | <li>multi-window text editor with multiple undo, Python colorizing, | ||||||
|  | @ -128,7 +128,7 @@ <h2>Menus<a class="headerlink" href="#menus" title="Permalink to this headline"> | ||||||
| <p>Output windows, such as used for Edit => Find in Files, are a subtype of editor | <p>Output windows, such as used for Edit => Find in Files, are a subtype of editor | ||||||
| window.  They currently have the same top menu but a different | window.  They currently have the same top menu but a different | ||||||
| default title and context menu.</p> | default title and context menu.</p> | ||||||
| <p>On MacOS, there is one application menu.  It dynamically changes according | <p>On macOS, there is one application menu.  It dynamically changes according | ||||||
| to the window currently selected.  It has an IDLE menu, and some entries | to the window currently selected.  It has an IDLE menu, and some entries | ||||||
| described below are moved around to conform to Apple guidlines.</p> | described below are moved around to conform to Apple guidlines.</p> | ||||||
| <div class="section" id="file-menu-shell-and-editor"> | <div class="section" id="file-menu-shell-and-editor"> | ||||||
|  | @ -304,7 +304,7 @@ <h3>Options menu (Shell and Editor)<a class="headerlink" href="#options-menu-she | ||||||
| <dt>Configure IDLE</dt> | <dt>Configure IDLE</dt> | ||||||
| <dd><p class="first">Open a configuration dialog and change preferences for the following: | <dd><p class="first">Open a configuration dialog and change preferences for the following: | ||||||
| fonts, indentation, keybindings, text color themes, startup windows and | fonts, indentation, keybindings, text color themes, startup windows and | ||||||
| size, additional help sources, and extensions (see below).  On OS X, | size, additional help sources, and extensions (see below).  On macOS, | ||||||
| open the configuration dialog by selecting Preferences in the application | open the configuration dialog by selecting Preferences in the application | ||||||
| menu.  To use a new built-in color theme (IDLE Dark) with older IDLEs, | menu.  To use a new built-in color theme (IDLE Dark) with older IDLEs, | ||||||
| save it as a new custom theme.</p> | save it as a new custom theme.</p> | ||||||
|  | @ -349,7 +349,7 @@ <h3>Help menu (Shell and Editor)<a class="headerlink" href="#help-menu-shell-and | ||||||
| </div> | </div> | ||||||
| <div class="section" id="context-menus"> | <div class="section" id="context-menus"> | ||||||
| <span id="index-4"></span><h3>Context Menus<a class="headerlink" href="#context-menus" title="Permalink to this headline">¶</a></h3> | <span id="index-4"></span><h3>Context Menus<a class="headerlink" href="#context-menus" title="Permalink to this headline">¶</a></h3> | ||||||
| <p>Open a context menu by right-clicking in a window (Control-click on OS X). | <p>Open a context menu by right-clicking in a window (Control-click on macOS). | ||||||
| Context menus have the standard clipboard functions also on the Edit menu.</p> | Context menus have the standard clipboard functions also on the Edit menu.</p> | ||||||
| <dl class="docutils"> | <dl class="docutils"> | ||||||
| <dt>Cut</dt> | <dt>Cut</dt> | ||||||
|  | @ -399,7 +399,7 @@ <h3>Editor windows<a class="headerlink" href="#editor-windows" title="Permalink | ||||||
| <div class="section" id="key-bindings"> | <div class="section" id="key-bindings"> | ||||||
| <h3>Key bindings<a class="headerlink" href="#key-bindings" title="Permalink to this headline">¶</a></h3> | <h3>Key bindings<a class="headerlink" href="#key-bindings" title="Permalink to this headline">¶</a></h3> | ||||||
| <p>In this section, ‘C’ refers to the <kbd class="kbd docutils literal notranslate">Control</kbd> key on Windows and Unix and | <p>In this section, ‘C’ refers to the <kbd class="kbd docutils literal notranslate">Control</kbd> key on Windows and Unix and | ||||||
| the <kbd class="kbd docutils literal notranslate">Command</kbd> key on Mac OSX.</p> | the <kbd class="kbd docutils literal notranslate">Command</kbd> key on macOS.</p> | ||||||
| <ul> | <ul> | ||||||
| <li><p class="first"><kbd class="kbd docutils literal notranslate">Backspace</kbd> deletes to the left; <kbd class="kbd docutils literal notranslate">Del</kbd> deletes to the right</p> | <li><p class="first"><kbd class="kbd docutils literal notranslate">Backspace</kbd> deletes to the left; <kbd class="kbd docutils literal notranslate">Del</kbd> deletes to the right</p> | ||||||
| </li> | </li> | ||||||
|  | @ -521,8 +521,8 @@ <h3>Python Shell window<a class="headerlink" href="#python-shell-window" title=" | ||||||
| <p>Command history</p> | <p>Command history</p> | ||||||
| <ul class="simple"> | <ul class="simple"> | ||||||
| <li><kbd class="kbd docutils literal notranslate">Alt-p</kbd> retrieves previous command matching what you have typed. On | <li><kbd class="kbd docutils literal notranslate">Alt-p</kbd> retrieves previous command matching what you have typed. On | ||||||
| OS X use <kbd class="kbd docutils literal notranslate">C-p</kbd>.</li> | macOS use <kbd class="kbd docutils literal notranslate">C-p</kbd>.</li> | ||||||
| <li><kbd class="kbd docutils literal notranslate">Alt-n</kbd> retrieves next. On OS X use <kbd class="kbd docutils literal notranslate">C-n</kbd>.</li> | <li><kbd class="kbd docutils literal notranslate">Alt-n</kbd> retrieves next. On macOS use <kbd class="kbd docutils literal notranslate">C-n</kbd>.</li> | ||||||
| <li><kbd class="kbd docutils literal notranslate">Return</kbd> while on any previous command retrieves that command</li> | <li><kbd class="kbd docutils literal notranslate">Return</kbd> while on any previous command retrieves that command</li> | ||||||
| </ul> | </ul> | ||||||
| </li> | </li> | ||||||
|  | @ -757,7 +757,7 @@ <h3>Setting preferences<a class="headerlink" href="#setting-preferences" title=" | ||||||
| custom key set in the Configure IDLE dialog under the keys tab.</p> | custom key set in the Configure IDLE dialog under the keys tab.</p> | ||||||
| </div> | </div> | ||||||
| <div class="section" id="idle-on-macos"> | <div class="section" id="idle-on-macos"> | ||||||
| <h3>IDLE on MacOS<a class="headerlink" href="#idle-on-macos" title="Permalink to this headline">¶</a></h3> | <h3>IDLE on macOS<a class="headerlink" href="#idle-on-macos" title="Permalink to this headline">¶</a></h3> | ||||||
| <p>Under System Preferences: Dock, one can set “Prefer tabs when opening | <p>Under System Preferences: Dock, one can set “Prefer tabs when opening | ||||||
| documents” to “Always”.  This setting is not compatible with the tk/tkinter | documents” to “Always”.  This setting is not compatible with the tk/tkinter | ||||||
| GUI framework used by IDLE, and it breaks a few IDLE features.</p> | GUI framework used by IDLE, and it breaks a few IDLE features.</p> | ||||||
|  | @ -817,7 +817,7 @@ <h3><a href="../contents.html">Table of Contents</a></h3> | ||||||
| <li><a class="reference internal" href="#help-and-preferences">Help and preferences</a><ul> | <li><a class="reference internal" href="#help-and-preferences">Help and preferences</a><ul> | ||||||
| <li><a class="reference internal" href="#help-sources">Help sources</a></li> | <li><a class="reference internal" href="#help-sources">Help sources</a></li> | ||||||
| <li><a class="reference internal" href="#setting-preferences">Setting preferences</a></li> | <li><a class="reference internal" href="#setting-preferences">Setting preferences</a></li> | ||||||
| <li><a class="reference internal" href="#idle-on-macos">IDLE on MacOS</a></li> | <li><a class="reference internal" href="#idle-on-macos">IDLE on macOS</a></li> | ||||||
| <li><a class="reference internal" href="#extensions">Extensions</a></li> | <li><a class="reference internal" href="#extensions">Extensions</a></li> | ||||||
| </ul> | </ul> | ||||||
| </li> | </li> | ||||||
|  | @ -899,7 +899,7 @@ <h3>Navigation</h3> | ||||||
| <br /> | <br /> | ||||||
|     <br /> |     <br /> | ||||||
| 
 | 
 | ||||||
|     Last updated on Nov 10, 2018. |     Last updated on Nov 12, 2018. | ||||||
|     <a href="https://docs.python.org/3/bugs.html">Found a bug</a>? |     <a href="https://docs.python.org/3/bugs.html">Found a bug</a>? | ||||||
|     <br /> |     <br /> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -41,7 +41,7 @@ | ||||||
|             # these problems, falling back to ASCII |             # these problems, falling back to ASCII | ||||||
|             locale_encoding = locale.nl_langinfo(locale.CODESET) |             locale_encoding = locale.nl_langinfo(locale.CODESET) | ||||||
|             if locale_encoding is None or locale_encoding == '': |             if locale_encoding is None or locale_encoding == '': | ||||||
|                 # situation occurs on Mac OS X |                 # situation occurs on macOS | ||||||
|                 locale_encoding = 'ascii' |                 locale_encoding = 'ascii' | ||||||
|             codecs.lookup(locale_encoding) |             codecs.lookup(locale_encoding) | ||||||
|         except (NameError, AttributeError, LookupError): |         except (NameError, AttributeError, LookupError): | ||||||
|  | @ -51,7 +51,7 @@ | ||||||
|             try: |             try: | ||||||
|                 locale_encoding = locale.getdefaultlocale()[1] |                 locale_encoding = locale.getdefaultlocale()[1] | ||||||
|                 if locale_encoding is None or locale_encoding == '': |                 if locale_encoding is None or locale_encoding == '': | ||||||
|                     # situation occurs on Mac OS X |                     # situation occurs on macOS | ||||||
|                     locale_encoding = 'ascii' |                     locale_encoding = 'ascii' | ||||||
|                 codecs.lookup(locale_encoding) |                 codecs.lookup(locale_encoding) | ||||||
|             except (ValueError, LookupError): |             except (ValueError, LookupError): | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| """ | """ | ||||||
| A number of functions that enhance IDLE on Mac OSX. | A number of functions that enhance IDLE on macOS. | ||||||
| """ | """ | ||||||
| from sys import platform  # Used in _init_tk_type, changed by test. | from sys import platform  # Used in _init_tk_type, changed by test. | ||||||
| 
 | 
 | ||||||
|  | @ -192,7 +192,7 @@ def help_dialog(event=None): | ||||||
|         root.bind('<<close-all-windows>>', flist.close_all_callback) |         root.bind('<<close-all-windows>>', flist.close_all_callback) | ||||||
| 
 | 
 | ||||||
|         # The binding above doesn't reliably work on all versions of Tk |         # The binding above doesn't reliably work on all versions of Tk | ||||||
|         # on MacOSX. Adding command definition below does seem to do the |         # on macOS. Adding command definition below does seem to do the | ||||||
|         # right thing for now. |         # right thing for now. | ||||||
|         root.createcommand('exit', flist.close_all_callback) |         root.createcommand('exit', flist.close_all_callback) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1 @@ | ||||||
|  | Where appropriate, use 'macOS' in idlelib. | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Terry Jan Reedy
						Terry Jan Reedy