Commit 94338de4 authored by Terry Jan Reedy's avatar Terry Jan Reedy

Issue #17390: Add Python version to Idle editor window title bar.

Original patches by Edmond Burnett and Kent Johnson.
parent 09761e7c
import importlib import importlib
import importlib.abc import importlib.abc
import os import os
from platform import python_version
import re import re
import string import string
import sys import sys
...@@ -955,11 +956,14 @@ class EditorWindow(object): ...@@ -955,11 +956,14 @@ class EditorWindow(object):
self.undo.reset_undo() self.undo.reset_undo()
def short_title(self): def short_title(self):
pyversion = "Python " + python_version() + ": "
filename = self.io.filename filename = self.io.filename
if filename: if filename:
filename = os.path.basename(filename) filename = os.path.basename(filename)
else:
filename = "Untitled"
# return unicode string to display non-ASCII chars correctly # 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): def long_title(self):
# return unicode string to display non-ASCII chars correctly # return unicode string to display non-ASCII chars correctly
......
...@@ -274,6 +274,9 @@ Library ...@@ -274,6 +274,9 @@ Library
IDLE 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 - Issue #18960: IDLE now ignores the source encoding declaration on the second
line if the first line contains anything except a comment. line if the first line contains anything except a comment.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment