craft_parts.packages.chisel module

Support for Chisel operations.

class craft_parts.packages.chisel.SlicesState(**data)

Bases: BaseModel

State for cut slices.

Parameters:

data (Any)

marshal()

Create a dictionary containing the part state data.

Return type:

dict[str, Any]

Returns:

The newly created dictionary.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod read(filepath)

Read state data from disk.

Parameters:

filepath (Path) – The path to the file to read.

Return type:

SlicesState

Returns:

The state object containing the slice data.

slices: set[str]
classmethod unmarshal(data)

Create and populate a new state object from dictionary data.

Parameters:

data (dict[str, Any]) – A dictionary containing the data to unmarshal.

Return type:

SlicesState

Returns:

The state object containing the slice data.

write(filepath)

Write state data to disk.

Parameters:

filepath (Path) – The path to the file to write.

Return type:

None

craft_parts.packages.chisel.cut_slices(slices, target_dir)

Cut Chisel slices into a destination path.

Parameters:
  • slices (list[str]) – The list of names of slices to cut.

  • target_dir (Path) – The destination directory.

Return type:

None