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

Method close

Lib/idlelib/redirector.py:53–64  ·  view source on GitHub ↗

Unregister operations and revert redirection created by .__init__.

(self)

Source from the content-addressed store, hash-verified

51 return f"{self.__class__.__name__,}({w.__class__.__name__}<{w._w}>)"
52
53 def close(self):
54 "Unregister operations and revert redirection created by .__init__."
55 for operation in list(self._operations):
56 self.unregister(operation)
57 widget = self.widget
58 tk = widget.tk
59 w = widget._w
60 # Restore the original widget Tcl command.
61 tk.deletecommand(w)
62 tk.call("rename", self.orig, w)
63 del self.widget, self.tk # Should not be needed
64 # if instance is deleted after close, as in Percolator.
65
66 def register(self, operation, function):
67 ''&#x27;Return OriginalCommand(operation) after registering function.

Callers 2

test_initMethod · 0.95
test_closeMethod · 0.95

Calls 4

unregisterMethod · 0.95
listClass · 0.85
deletecommandMethod · 0.80
callMethod · 0.45

Tested by 2

test_initMethod · 0.76
test_closeMethod · 0.76