]> 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:46 +0000 (00:36 -0500)
committerTerry Jan Reedy <tjreedy@udel.edu>
Thu, 23 Jan 2014 05:36:46 +0000 (00:36 -0500)
Original patches by Edmond Burnett and Kent Johnson.

Lib/idlelib/EditorWindow.py
Misc/NEWS

index c9ad364c2c89de6667f5791d5b2d7feba14e01c1..4bf111148284f91453974210e374c28a610fe463 100644 (file)
@@ -1,6 +1,7 @@
 import importlib
 import importlib.abc
 import os
+from platform import python_version
 import re
 import string
 import sys
@@ -955,11 +956,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 a89762d85087775e74dea5b5607819d6d5ee2589..43727016fbc7c6461f5a9623c20d99baca93bf97 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -274,6 +274,9 @@ Library
 IDLE
 ----
 
+--Issue #17390: Add Python version to Idle editor window title bar.
+  Original patches by Edmond Burnett and Kent Johnson.
+  
 - Issue #18960: IDLE now ignores the source encoding declaration on the second
   line if the first line contains anything except a comment.