Paths manager
Paths
Model class for the Backup Juggler application.
Attributes:
| Name | Type | Description |
|---|---|---|
_source |
Path
|
The source directory or file path. |
_destination |
Path
|
The destination directory. |
_total_size |
int
|
The total size of the files to be copied. |
Methods
- source: Get the source path.
- destination: Get the destination directory.
- total_size: Get the total size of the files to be copied.
Notes
- The total size calculation includes subdirectories and files within the source directory.
- The total size is calculated only once during the initialization of the
Pathsinstance.
Source code in backup_juggler/paths_manager.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
destination: Path
property
Get the destination directory.
Returns:
| Name | Type | Description |
|---|---|---|
_destination |
Path
|
The destination directory. |
source: Path
property
Get the source path.
Returns:
| Name | Type | Description |
|---|---|---|
_source |
Path
|
The source path. |
total_size: int
property
Get the total size of the files to be copied.
Returns:
| Name | Type | Description |
|---|---|---|
_total_size |
int
|
The total size in bytes. |
__init__(source, destination=None)
Initialize a Paths instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source |
Path
|
The source directory or file path. |
required |
destination |
Path
|
The destination directory. Defaults to |
None
|
Source code in backup_juggler/paths_manager.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |