changeset: 92098:ba141f9e58b6 branch: 3.4 parent: 92094:46504edf7594 user: Terry Jan Reedy date: Thu Aug 14 21:54:43 2014 -0400 files: Lib/idlelib/EditorWindow.py description: Issue #17390: Adjust Editor window title. Remove 'Python', move version to end. diff -r 46504edf7594 -r ba141f9e58b6 Lib/idlelib/EditorWindow.py --- a/Lib/idlelib/EditorWindow.py Thu Aug 14 22:21:18 2014 +0300 +++ b/Lib/idlelib/EditorWindow.py Thu Aug 14 21:54:43 2014 -0400 @@ -2,7 +2,7 @@ import importlib.abc import importlib.util import os -from platform import python_version +import platform import re import string import sys @@ -26,6 +26,8 @@ # The default tab setting for a Text widget, in average-width characters. TK_TABWIDTH_DEFAULT = 8 +_py_version = ' (%s)' % platform.python_version() + def _sphinx_version(): "Format sys.version_info to produce the Sphinx version string used to install the chm docs" major, minor, micro, level, serial = sys.version_info @@ -944,7 +946,7 @@ short = self.short_title() long = self.long_title() if short and long: - title = short + " - " + long + title = short + " - " + long + _py_version elif short: title = short elif long: @@ -968,14 +970,13 @@ self.undo.reset_undo() def short_title(self): - pyversion = "Python " + python_version() + ": " filename = self.io.filename if filename: filename = os.path.basename(filename) else: filename = "Untitled" # return unicode string to display non-ASCII chars correctly - return pyversion + self._filename_to_unicode(filename) + return self._filename_to_unicode(filename) def long_title(self): # return unicode string to display non-ASCII chars correctly