pysnt.display.utils module#

Display utilities for PySNT.

This module contains shared utilities, helper functions, configuration parameter extraction, error handling patterns, and type checking utilities used across the display system.

register_display_handler(obj_type: str, handler_func)[source]#

Register a custom display handler for a specific SNT object type.

This function allows users to register custom display handlers for specific SNT object types. When an object of the registered type is displayed, the custom handler will be called instead of the default display logic.

Parameters:
  • obj_type (str) – The SNT object type identifier (e.g., ‘SNT_Tree’, ‘SNT_Path’)

  • handler_func (Callable[[Dict[str, Any]], None]) – Function that takes an SNTObject dictionary and displays it

Examples

>>> def display_my_object(snt_dict):
...     print(f"My object: {snt_dict.get('name')}")
>>>
>>> register_display_handler('SNT_MyObject', display_my_object)