craft_parts.executor.part_handler module

Definitions and helpers for part handlers.

class craft_parts.executor.part_handler.PartHandler(part, *, part_info, part_list, track_stage_packages=False, overlay_manager, ignore_patterns=None, base_layer_hash=None)[source]

Bases: object

Handle lifecycle steps for a part.

Parameters:
  • part (Part) – The part being processed.

  • part_info (PartInfo) – Information about the part being processed.

  • part_list (list[Part]) – A list containing all parts.

  • track_stage_packages (bool)

  • overlay_manager (OverlayManager)

  • ignore_patterns (Optional[list[str]])

  • base_layer_hash (Optional[LayerHash])

clean_step(step)[source]

Remove the work files and the state of the given step.

Parameters:

step (Step) – The step to clean.

Return type:

None

run_action(action, *, stdout=None, stderr=None)[source]

Execute the given action for this part using a plugin.

Parameters:
  • action (Action) – The action to execute.

  • stdout (Union[TextIO, int, None])

  • stderr (Union[TextIO, int, None])

Return type:

None