stubgen

Helper functions for adding to previously generated stub files.

add_info_to_stub

add_info_to_stub(cls: Any, method: Any, is_property: bool = False) -> None

Add information to a stub file.

This method requires that an environment variable named TM_DEVICES_STUB_DIR is defined that points to the stub directory for tm_devices.

Parameters:
  • cls (Any) –

    The class object that the method is being added to.

  • method (Any) –

    The method to add to a stub.

  • is_property (bool, default: False ) –

    A boolean indicating the method is a property.

Raises:
  • AssertionError

    Indicates that the file that needs to be updated does not exist.

  • ValueError

    Indicates that the class could not be found in the stub file.