Skip to content

pythontypemaker

Prepare and compile python script types.

Attributes

mlogger = logger.get_logger(__name__) module-attribute

Functions

create_executor_type(extension, module_builder, cmd_component)

Create the dotnet type for the executor.

Parameters:

Name Type Description Default
extension Extension

pyRevit extension

required
module_builder ModuleBuilder

module builder

required
cmd_component GenericUICommand

command

required
Source code in pyrevitlib/pyrevit/runtime/pythontypemaker.py
def create_executor_type(extension, module_builder, cmd_component):
    """Create the dotnet type for the executor.

    Args:
        extension (pyrevit.extensions.components.Extension): pyRevit extension
        module_builder (ModuleBuilder): module builder
        cmd_component (pyrevit.extensions.genericcomps.GenericUICommand):
            command
    """
    cmd_component.requires_clean_engine = \
        _does_need_clean_engine(extension, cmd_component)

    engine_configs = runtime.create_ipyengine_configs(
        clean=cmd_component.requires_clean_engine,
        full_frame=cmd_component.requires_fullframe_engine,
        persistent=cmd_component.requires_persistent_engine,
    )

    bundletypemaker.create_executor_type(
        extension,
        module_builder,
        cmd_component,
        eng_cfgs=engine_configs
        )