summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2014-01-23 00:36:46 -0500
committerTerry Jan Reedy <tjreedy@udel.edu>2014-01-23 00:36:46 -0500
commit94338de49b6eb67efbaae6112787f2596a16d9d6 (patch)
treeeab45846c4ec75d6c03670b6859d12a251020a5c
parent09761e7c9cf984b8164c172fcf9f1a5994402495 (diff)
downloadcpython-git-94338de49b6eb67efbaae6112787f2596a16d9d6.tar.gz
Issue #17390: Add Python version to Idle editor window title bar.
Original patches by Edmond Burnett and Kent Johnson.
-rw-r--r--Lib/idlelib/EditorWindow.py6
-rw-r--r--Misc/NEWS3
2 files changed, 8 insertions, 1 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index c9ad364c2c..4bf1111482 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -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
diff --git a/Misc/NEWS b/Misc/NEWS
index a89762d850..43727016fb 100644
--- 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.