From 592436552816f23b585e0a8e25284eeb1d25a184 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Thu, 23 Jan 2014 00:36:37 -0500 Subject: Issue #17390: Add Python version to Idle editor window title bar. Original patches by Edmond Burnett and Kent Johnson. --- Lib/idlelib/EditorWindow.py | 6 +++++- Misc/ACKS | 1 + Misc/NEWS | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 07ca556..3c1816a 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -1,5 +1,6 @@ import sys import os +from platform import python_version import re import imp from Tkinter import * @@ -965,11 +966,14 @@ class EditorWindow(object): 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 self._filename_to_unicode(filename) + return pyversion + self._filename_to_unicode(filename) def long_title(self): # return unicode string to display non-ASCII chars correctly diff --git a/Misc/ACKS b/Misc/ACKS index 208576d..28d6f15 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -145,6 +145,7 @@ Erik de Bueger Dick Bulterman Bill Bumgarner Jimmy Burgett +Edmond Burnett Tommy Burnette Roger Burnham Alastair Burt diff --git a/Misc/NEWS b/Misc/NEWS index 54aac52..506a0c0 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -183,6 +183,9 @@ Tools/Demos IDLE ---- +- Issue #17390: Add Python version to Idle editor window title bar. + Original patches by Edmond Burnett and Kent Johnson. + - Issue #20058: sys.stdin.readline() in IDLE now always returns only one line. - Issue #19481: print() of unicode, str or bytearray subclass instance in IDLE -- cgit v0.12