Commit b4f7a8e0 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 23ee797a
import sys import sys
import os import os
from platform import python_version
import re import re
import imp import imp
from Tkinter import * from Tkinter import *
...@@ -965,11 +966,14 @@ class EditorWindow(object): ...@@ -965,11 +966,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
......
...@@ -145,6 +145,7 @@ Erik de Bueger ...@@ -145,6 +145,7 @@ Erik de Bueger
Dick Bulterman Dick Bulterman
Bill Bumgarner Bill Bumgarner
Jimmy Burgett Jimmy Burgett
Edmond Burnett
Tommy Burnette Tommy Burnette
Roger Burnham Roger Burnham
Alastair Burt Alastair Burt
......
...@@ -183,6 +183,9 @@ Tools/Demos ...@@ -183,6 +183,9 @@ Tools/Demos
IDLE 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 #20058: sys.stdin.readline() in IDLE now always returns only one line.
- Issue #19481: print() of unicode, str or bytearray subclass instance in IDLE - Issue #19481: print() of unicode, str or bytearray subclass instance in IDLE
......
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