mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Issue #17390: Add Python version to Idle editor window title bar.
Original patches by Edmond Burnett and Kent Johnson.
This commit is contained in:
parent
09761e7c9c
commit
94338de49b
2 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue