objwatch package¶
Subpackages¶
- objwatch.utils package
- objwatch.wrappers package
Submodules¶
objwatch.core module¶
objwatch.event_handls module¶
- class objwatch.event_handls.EventHandls(output_xml: str | None = None)[source]¶
Bases:
objectHandles various events for ObjWatch, including function execution and variable updates. Optionally saves the events in an XML format.
- determine_change_type(old_value_len: int, current_value_len: int) EventType[source]¶
Determine the type of change based on the difference in lengths.
- Args:
old_value_len (int): Previous length of the data structure. current_value_len (int): New length of the data structure.
- Returns:
EventType: The determined event type (APD or POP).
- static format_sequence(seq: Any, max_elements: int = 3, func: LambdaType | None = None) str[source]¶
Format a sequence to display a limited number of elements.
- Args:
seq (Any): The sequence to format. max_elements (int): Maximum number of elements to display. func (Optional[FunctionType]): Optional function to process elements.
- Returns:
str: The formatted sequence string.
- handle_apd(lineno: int, class_name: str, key: str, value_type: type, old_value_len: int, current_value_len: int, call_depth: int, index_info: str) None[source]¶
Handle the ‘apd’ event denoting the addition of elements to data structures.
- Args:
lineno (int): The line number where the event is called. class_name (str): Name of the class containing the data structure. key (str): Name of the data structure. value_type (type): Type of the elements being added. old_value_len (int): Previous length of the data structure. current_value_len (int): New length of the data structure. call_depth (int): Current depth of the call stack. index_info (str): Information about the index to track in a multi-process environment.
- handle_end(lineno: int, func_info: Dict[str, Any], abc_wrapper: Any | None, call_depth: int, index_info: str, result: Any) None[source]¶
Handle the ‘end’ event indicating the end of a function or method execution.
- handle_pop(lineno: int, class_name: str, key: str, value_type: type, old_value_len: int, current_value_len: int, call_depth: int, index_info: str) None[source]¶
Handle the ‘pop’ event marking the removal of elements from data structures.
- Args:
lineno (int): The line number where the event is called. class_name (str): Name of the class containing the data structure. key (str): Name of the data structure. value_type (type): Type of the elements being removed. old_value_len (int): Previous length of the data structure. current_value_len (int): New length of the data structure. call_depth (int): Current depth of the call stack. index_info (str): Information about the index to track in a multi-process environment.
- handle_run(lineno: int, func_info: Dict[str, Any], abc_wrapper: Any | None, call_depth: int, index_info: str) None[source]¶
Handle the ‘run’ event indicating the start of a function or method execution.
- handle_upd(lineno: int, class_name: str, key: str, old_value: Any, current_value: Any, call_depth: int, index_info: str, abc_wrapper: Any | None = None) None[source]¶
Handle the ‘upd’ event representing the creation or updating of a variable.
- Args:
lineno (int): The line number where the event is called. class_name (str): Name of the class containing the variable. key (str): Variable name. old_value (Any): Previous value of the variable. current_value (Any): New value of the variable. call_depth (int): Current depth of the call stack. index_info (str): Information about the index to track in a multi-process environment. abc_wrapper (Optional[Any]): Custom wrapper for additional processing.