protocols
flavor.psp.protocols
¶
PSP Protocol Definitions - Type-safe interfaces for PSP operations.
Defines protocols for common PSP operations that can be implemented by different format versions (PSPF/2025, future formats, etc.).
Classes¶
ExtractorProtocol
¶
Bases: Protocol
Protocol for package slot extraction.
Functions¶
extract_slot
¶
Extract a specific slot to a directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slot_index
|
int
|
Index of the slot to extract |
required |
dest_dir
|
Path
|
Destination directory for extraction |
required |
verify_checksum
|
bool
|
Whether to verify checksums during extraction |
True
|
Returns:
| Type | Description |
|---|---|
Path
|
Path to the extracted content |
Source code in flavor/psp/protocols.py
IntegrityVerifierProtocol
¶
Bases: Protocol
Protocol for package integrity verification.
Any class that implements this protocol can verify package integrity, regardless of the underlying format implementation.
Functions¶
verify_integrity
¶
Verify the integrity of a package bundle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bundle_path
|
Path
|
Path to the package bundle file |
required |
Returns:
| Type | Description |
|---|---|
IntegrityResult
|
IntegrityResult dictionary with verification status |