MCPcopy
hub / github.com/google/python-fire / AddCalledComponent

Method AddCalledComponent

fire/trace.py:95–119  ·  view source on GitHub ↗

Adds an element to the trace indicating that a component was called. Also applies to instantiating a class. Args: component: The result of calling the callable. target: The name of the callable. args: The args consumed in order to call this callable. filename: The f

(self, component, target, args, filename, lineno,
                         capacity, action=CALLED_CALLABLE)

Source from the content-addressed store, hash-verified

93 self.elements.append(element)
94
95 def AddCalledComponent(self, component, target, args, filename, lineno,
96 capacity, action=CALLED_CALLABLE):
97 """Adds an element to the trace indicating that a component was called.
98
99 Also applies to instantiating a class.
100
101 Args:
102 component: The result of calling the callable.
103 target: The name of the callable.
104 args: The args consumed in order to call this callable.
105 filename: The file in which the callable is defined, or None if N/A.
106 lineno: The line number on which the callable is defined, or None if N/A.
107 capacity: (bool) Whether the callable could have accepted additional args.
108 action: The value to include as the action in the FireTraceElement.
109 """
110 element = FireTraceElement(
111 component=component,
112 action=action,
113 target=target,
114 args=args,
115 filename=filename,
116 lineno=lineno,
117 capacity=capacity,
118 )
119 self.elements.append(element)
120
121 def AddCompletionScript(self, script):
122 element = FireTraceElement(

Callers 7

testAddCalledCallableMethod · 0.95
testAddCalledRoutineMethod · 0.95
testGetCommandMethod · 0.95
_CallAndUpdateTraceFunction · 0.80

Calls 1

FireTraceElementClass · 0.85

Tested by 6

testAddCalledCallableMethod · 0.76
testAddCalledRoutineMethod · 0.76
testGetCommandMethod · 0.76