1- # SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
1+ # SPDX-FileCopyrightText: 2024 Justin Myers
22#
33# SPDX-License-Identifier: MIT
44
@@ -19,9 +19,7 @@ def get_board_pins(pin_filename):
1919
2020 search = re .search (r"MP_ROM_QSTR\(MP_QSTR_(.*?)\), MP_ROM_PTR" , line )
2121 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 )
2523 if search is None :
2624 continue
2725
@@ -112,7 +110,9 @@ def create_board_stubs(board_id, records, mappings, board_filename):
112110 elif extra == "epaper_display" :
113111 import_name = "EPaperDisplay"
114112 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+ )
116116 member_data += f"The object created is a singleton, and uses the default parameter values for `{ class_name } `.\n "
117117 member_data += '"""\n '
118118 member_data += f"{ board_member } : { class_name } \n "
@@ -130,9 +130,7 @@ def create_board_stubs(board_id, records, mappings, board_filename):
130130 frozen_libraries = ", " .join (libraries ["frozen_libraries" ])
131131
132132 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 " )
136134 boards_file .write ("#\n " )
137135 boards_file .write ("# SPDX-License-Identifier: MIT\n " )
138136 boards_file .write ('"""\n ' )
@@ -244,7 +242,9 @@ def build_stubs(circuitpython_dir, circuitpython_org_dir, export_dir, version="8
244242
245243 libraries = {}
246244 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+ )
248248 else :
249249 with open (f"{ circuitpython_org_dir } /_data/files.json" ) as libraries_file :
250250 libraries_list = json .load (libraries_file )
@@ -287,9 +287,7 @@ def build_stubs(circuitpython_dir, circuitpython_org_dir, export_dir, version="8
287287 board_name = board
288288 with open (f"{ board_path } /mpconfigboard.h" ) as get_name :
289289 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 )
293291 if board_name_re :
294292 board_name = board_name_re .group (1 ).strip ('"' )
295293
@@ -309,5 +307,6 @@ def build_stubs(circuitpython_dir, circuitpython_org_dir, export_dir, version="8
309307
310308 process (board_mappings , export_dir )
311309
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