|
19 | 19 | # Define the base directory to crawl
|
20 | 20 | BASE_DIR = "../ardupilot/libraries/AP_HAL_ChibiOS/hwdef/"
|
21 | 21 |
|
22 |
| -hwdef_dict = dict[str, tuple[int, int, int, str, str, str]] |
| 22 | +HwdefDict = dict[str, tuple[int, int, int, str, str, str]] |
23 | 23 |
|
24 | 24 | logging.basicConfig(level="INFO", format="%(asctime)s - %(levelname)s - %(message)s")
|
25 | 25 |
|
@@ -52,8 +52,8 @@ def remove_suffixes(base_dirname: str, suffixes: list) -> str:
|
52 | 52 | return base_dirname
|
53 | 53 |
|
54 | 54 |
|
55 |
| -def process_hwdef_files(base_directory: str) -> hwdef_dict: |
56 |
| - hwdef_data: hwdef_dict = {} |
| 55 | +def process_hwdef_files(base_directory: str) -> HwdefDict: |
| 56 | + hwdef_data: HwdefDict = {} |
57 | 57 |
|
58 | 58 | # Walk through the directory
|
59 | 59 | for dirpath, _dirnames, filenames in os.walk(base_directory):
|
@@ -85,7 +85,7 @@ def process_hwdef_files(base_directory: str) -> hwdef_dict:
|
85 | 85 |
|
86 | 86 |
|
87 | 87 | def create_dicts( # pylint: disable=too-many-locals
|
88 |
| - hwdef_data: hwdef_dict, |
| 88 | + hwdef_data: HwdefDict, |
89 | 89 | ) -> tuple[dict[int, str], dict[tuple[int, int], str], dict[int, str], dict[int, str], dict[int, str]]:
|
90 | 90 | vid_vendor_dict: dict[int, str] = {}
|
91 | 91 | vid_pid_product_dict: dict[tuple[int, int], str] = {}
|
@@ -227,7 +227,7 @@ def main() -> None:
|
227 | 227 | apj_board_id_vendor_dict: dict[int, str] = {}
|
228 | 228 | mcu_series_dict: dict[int, str] = {}
|
229 | 229 |
|
230 |
| - hwdef_data: hwdef_dict = process_hwdef_files(BASE_DIR) |
| 230 | + hwdef_data: HwdefDict = process_hwdef_files(BASE_DIR) |
231 | 231 | vid_vendor_dict, vid_pid_product_dict, apj_board_id_name_dict, apj_board_id_vendor_dict, mcu_series_dict = create_dicts(
|
232 | 232 | hwdef_data
|
233 | 233 | )
|
|
0 commit comments