]> granicus.if.org Git - python/commitdiff
Issue #17390: Add Python version to Idle editor window title bar.
authorTerry Jan Reedy <tjreedy@udel.edu>
Thu, 23 Jan 2014 05:36:37 +0000 (00:36 -0500)
committerTerry Jan Reedy <tjreedy@udel.edu>
Thu, 23 Jan 2014 05:36:37 +0000 (00:36 -0500)
Original patches by Edmond Burnett and Kent Johnson.

Lib/idlelib/EditorWindow.py
Misc/ACKS
Misc/NEWS

index 07ca5562330e7868a4689726ebd779ca9f6ca618..3c1816a1ee542756bc23bca588522aed2faaec98 100644 (file)
@@ -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
index 208576df74d500de615e5b757495b18d80b57f35..28d6f1526fa2385b81a7d9e3dcab897ef0e0a42e 100644 (file)
--- 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
index 54aac520c2f18ebc8c1da69f8df753eedfbf6f94..506a0c0521458e0a64ad42af8bd1cf9c6875d1f3 100644 (file)
--- 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