1
- # SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
1
+ # SPDX-FileCopyrightText: 2024 Justin Myers
2
2
#
3
3
# SPDX-License-Identifier: MIT
4
4
@@ -19,9 +19,7 @@ def get_board_pins(pin_filename):
19
19
20
20
search = re .search (r"MP_ROM_QSTR\(MP_QSTR_(.*?)\), MP_ROM_PTR" , line )
21
21
if search is None :
22
- search = re .search (
23
- r"MP_OBJ_NEW_QSTR\(MP_QSTR_(.*?)\), MP_ROM_PTR" , line
24
- )
22
+ search = re .search (r"MP_OBJ_NEW_QSTR\(MP_QSTR_(.*?)\), MP_ROM_PTR" , line )
25
23
if search is None :
26
24
continue
27
25
@@ -112,7 +110,9 @@ def create_board_stubs(board_id, records, mappings, board_filename):
112
110
elif extra == "epaper_display" :
113
111
import_name = "EPaperDisplay"
114
112
class_name = f"displayio.{ import_name } "
115
- member_data = f'"""Returns the `{ class_name } ` object for the board\' s built in display.\n '
113
+ member_data = (
114
+ f'"""Returns the `{ class_name } ` object for the board\' s built in display.\n '
115
+ )
116
116
member_data += f"The object created is a singleton, and uses the default parameter values for `{ class_name } `.\n "
117
117
member_data += '"""\n '
118
118
member_data += f"{ board_member } : { class_name } \n "
@@ -130,9 +130,7 @@ def create_board_stubs(board_id, records, mappings, board_filename):
130
130
frozen_libraries = ", " .join (libraries ["frozen_libraries" ])
131
131
132
132
with open (board_filename , "w" ) as boards_file :
133
- boards_file .write (
134
- "# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries\n "
135
- )
133
+ boards_file .write ("# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries\n " )
136
134
boards_file .write ("#\n " )
137
135
boards_file .write ("# SPDX-License-Identifier: MIT\n " )
138
136
boards_file .write ('"""\n ' )
@@ -244,7 +242,9 @@ def build_stubs(circuitpython_dir, circuitpython_org_dir, export_dir, version="8
244
242
245
243
libraries = {}
246
244
if circuitpython_org_dir is None :
247
- libraries = shared_bindings_matrix .support_matrix_by_board (use_branded_name = False , withurl = False )
245
+ libraries = shared_bindings_matrix .support_matrix_by_board (
246
+ use_branded_name = False , withurl = False
247
+ )
248
248
else :
249
249
with open (f"{ circuitpython_org_dir } /_data/files.json" ) as libraries_file :
250
250
libraries_list = json .load (libraries_file )
@@ -287,9 +287,7 @@ def build_stubs(circuitpython_dir, circuitpython_org_dir, export_dir, version="8
287
287
board_name = board
288
288
with open (f"{ board_path } /mpconfigboard.h" ) as get_name :
289
289
board_contents = get_name .read ()
290
- board_name_re = re .search (
291
- r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)" , board_contents
292
- )
290
+ board_name_re = re .search (r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)" , board_contents )
293
291
if board_name_re :
294
292
board_name = board_name_re .group (1 ).strip ('"' )
295
293
@@ -309,5 +307,6 @@ def build_stubs(circuitpython_dir, circuitpython_org_dir, export_dir, version="8
309
307
310
308
process (board_mappings , export_dir )
311
309
312
- if __name__ == '__main__' :
313
- build_stubs ("./" , None , "circuitpython-stubs/board_definitions/" )
310
+
311
+ if __name__ == "__main__" :
312
+ build_stubs ("./" , None , "circuitpython-stubs/board_definitions/" )
0 commit comments