operations
flavor.psp.format_2025.operations
¶
TODO: Add module docstring.
Functions¶
operations_to_string
¶
Convert packed operations to human-readable string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
packed
|
int
|
Packed operations as 64-bit integer |
required |
Returns:
| Type | Description |
|---|---|
str
|
String representation like "TAR|GZIP" or standard format like "tar.gz" |
Example
operations_to_string(0x1001) "tar.gz"
Source code in flavor/psp/format_2025/operations.py
pack_operations
¶
Pack a list of operations into a 64-bit integer.
Each operation takes 8 bits, allowing up to 8 operations in the chain. Operations are packed in execution order (first operation in LSB).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operations
|
list[int]
|
List of operation constants (max 8) |
required |
Returns:
| Type | Description |
|---|---|
int
|
Packed 64-bit integer |
Raises:
| Type | Description |
|---|---|
ValueError
|
If operation is invalid or unsupported in v0 |
Example
pack_operations([OP_TAR, OP_GZIP]) 0x1001 # 0x01 | (0x10 << 8)
Source code in flavor/psp/format_2025/operations.py
string_to_operations
¶
Parse operation string to packed operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
op_string
|
str
|
String like "tar|gzip", "tar.gz", or "raw" |
required |
Returns:
| Type | Description |
|---|---|
int
|
Packed operations as 64-bit integer |
Raises:
| Type | Description |
|---|---|
ValueError
|
If operation string is invalid or uses unsupported operations |
Example
string_to_operations("tar.gz") 0x1001 string_to_operations("tar|gzip") 0x1001
Source code in flavor/psp/format_2025/operations.py
unpack_operations
¶
Unpack a 64-bit integer into a list of operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
packed
|
int
|
Packed 64-bit integer |
required |
Returns:
| Type | Description |
|---|---|
list[int]
|
List of operation constants |
Example
unpack_operations(0x1001) [OP_TAR, OP_GZIP]