Index
adapters
AXM Adapters package.
FileSystemAdapter
Adapter for atomic filesystem operations.
Supports both single operations and transactions for multi-file atomic operations with rollback on failure.
Source code in packages/axm-init/src/axm_init/adapters/filesystem.py
create_dir(path)
Create a directory (and parents).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Directory path to create. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if successful. |
Source code in packages/axm-init/src/axm_init/adapters/filesystem.py
transaction()
Context manager for atomic multi-file operations.
On success: files are kept. On exception: all created files are rolled back.
Yields:
| Type | Description |
|---|---|
Transaction
|
Transaction object for tracked operations. |
Source code in packages/axm-init/src/axm_init/adapters/filesystem.py
write_file(path, content)
Write content to a file, creating parent directories.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Target file path. |
required |
content
|
str
|
File content to write. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if successful. |