MCPcopy Index your code
hub / github.com/python/cpython / saved_change_hook

Method saved_change_hook

Lib/idlelib/editor.py:994–1023  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

992 return open_recent_file
993
994 def saved_change_hook(self):
995 short = self.short_title()
996 long = self.long_title()
997 _py_version = ' (%s)' % platform.python_version()
998 if short and long and not macosx.isCocoaTk():
999 # Don't use both values on macOS because
1000 # that doesn't match platform conventions.
1001 title = short + " - " + long + _py_version
1002 elif short:
1003 if short == "IDLE Shell":
1004 title = short + " " + platform.python_version()
1005 else:
1006 title = short + _py_version
1007 elif long:
1008 title = long
1009 else:
1010 title = "untitled"
1011 icon = short or long or title
1012 if not self.get_saved():
1013 title = "*%s*" % title
1014 icon = "*%s" % icon
1015 self.top.wm_title(title)
1016 self.top.wm_iconname(icon)
1017
1018 if macosx.isCocoaTk():
1019 # Add a proxy icon to the window title
1020 self.top.wm_attributes("-titlepath", long)
1021
1022 # Maintain the modification status for the window
1023 self.top.wm_attributes("-modified", not self.get_saved())
1024
1025 def get_saved(self):
1026 return self.undo.get_saved()

Callers 4

__init__Method · 0.95
filename_change_hookMethod · 0.95
check_savedMethod · 0.80
filename_changed_editMethod · 0.80

Calls 6

short_titleMethod · 0.95
long_titleMethod · 0.95
get_savedMethod · 0.95
wm_titleMethod · 0.80
wm_iconnameMethod · 0.80
wm_attributesMethod · 0.80

Tested by

no test coverage detected