Skip to content

Import Mode

app.application.services.helpers.import_mode

View source code

Import merge-strategy enum shared by all layer import services.

See Also

Layer: Application. Context: Coordinates domain state and infrastructure to complete application use cases.

ImportMode

Bases: str, Enum

Controls how incoming layer data is reconciled with the existing target layer.

ATTRIBUTE DESCRIPTION
OVERWRITE

Wipe the entire target layer first, then load every box from the file. This is the safest option when the file is the authoritative source.

MERGE_REPLACE

For every frame index present in the file, replace that frame's boxes in the target layer with the imported ones. Frames that are not mentioned in the file are left untouched.

MERGE_IGNORE

Only populate frames that currently have no boxes. Any frame that already contains data is skipped silently.

MERGE_RENAME

Add every box from the file to the target layer. If an imported box has a key that already exists in the target frame, the box is added with a "imp-" prefix on both key and id to avoid collision.

Note

The dialog offers all four modes with human-readable labels. The services receive the enum value and apply the corresponding strategy via _layer_io.apply_import_to_layer().

Layer: Application. Context: Coordinates use-case behavior through domain services and application contracts.

MERGE_IGNORE = 'merge_ignore' class-attribute instance-attribute

MERGE_RENAME = 'merge_rename' class-attribute instance-attribute

MERGE_REPLACE = 'merge_replace' class-attribute instance-attribute

OVERWRITE = 'overwrite' class-attribute instance-attribute

display_label: str property

Return the user-facing label for this import mode.

RETURNS DESCRIPTION
str

Label describing the import mode's merge or overwrite behavior.