Commit 671de90
authored
Improve Path Handling for Structure Commands (#26)
#### **Overview**
This PR improves the handling of file paths within the `generate` and
`list` commands of the `struct_module`.
#### **Changes**
- Introduced consistent path resolution for `contribs` directory using
`os.path.dirname` and `os.path.realpath`.
- Simplified and clarified logic for determining `file_path` in
`generate.py`.
- Enhanced logic in `list.py` to aggregate structures from multiple
directories (`structures_path` and `contribs`).
- Ensured error handling and path existence checks are more robust and
better logged.
#### **Justification**
- Resolving paths centrally reduces redundancy and the risk of bugs.
- Aggregating structures from multiple sources improves functionality
and user experience.
#### **Impact**
- Commands `generate` and `list` now handle paths more reliably.
- Users benefit from more informative error messages and a broader set
of structure files in the listing command.1 parent 9d565e0 commit 671de90
2 files changed
Lines changed: 20 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 49 | + | |
| 50 | + | |
50 | 51 | | |
51 | | - | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | | - | |
28 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
0 commit comments