MCPcopy Index your code
hub / github.com/RustPython/RustPython / _setup

Method _setup

Lib/tkinter/__init__.py:2732–2762  ·  view source on GitHub ↗

Internal function. Sets up information about children.

(self, master, cnf)

Source from the content-addressed store, hash-verified

2730 """Internal class."""
2731
2732 def _setup(self, master, cnf):
2733 """Internal function. Sets up information about children."""
2734 if master is None:
2735 master = _get_default_root()
2736 self.master = master
2737 self.tk = master.tk
2738 name = None
2739 if 'name' in cnf:
2740 name = cnf['name']
2741 del cnf['name']
2742 if not name:
2743 name = self.__class__.__name__.lower()
2744 if name[-1].isdigit():
2745 name += "!" # Avoid duplication when calculating names below
2746 if master._last_child_ids is None:
2747 master._last_child_ids = {}
2748 count = master._last_child_ids.get(name, 0) + 1
2749 master._last_child_ids[name] = count
2750 if count == 1:
2751 name = '!%s' % (name,)
2752 else:
2753 name = '!%s%d' % (name, count)
2754 self._name = name
2755 if master._w=='.':
2756 self._w = '.' + name
2757 else:
2758 self._w = master._w + '.' + name
2759 self.children = {}
2760 if self._name in self.master.children:
2761 self.master.children[self._name].destroy()
2762 self.master.children[self._name] = self
2763
2764 def __init__(self, master, widgetName, cnf={}, kw={}, extra=()):
2765 """Construct a widget with the parent widget MASTER, a name WIDGETNAME

Callers 4

__init__Method · 0.95
__init__Method · 0.45
_setupMethod · 0.45
__init__.pyFile · 0.45

Calls 5

_get_default_rootFunction · 0.85
lowerMethod · 0.45
isdigitMethod · 0.45
getMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected