createstubs
¶
Create stubs for (all) modules on a MicroPython board
Module Contents¶
Classes¶
Generate stubs for modules in firmware |
Functions¶
|
Create nested folders if needed |
|
|
|
|
|
|
|
Read the board name from the boardname.py file that may have been created upfront |
|
Determine the root folder of the device |
|
|
|
get --path from cmdline. [unix/win] |
|
runtime test to determine full or micropython |
|
Attributes¶
- createstubs.__version__ = 'v1.17.2'¶
- createstubs.ENOENT = 2¶
- createstubs._MAX_CLASS_LEVEL = 2¶
- createstubs.LIBS = ['lib', '/lib', '/sd/lib', '/flash/lib', '.']¶
- class createstubs.logging¶
- INFO = 20¶
- WARNING = 30¶
- ERROR = 40¶
- level¶
- prnt¶
- static getLogger(name)¶
- classmethod basicConfig(level)¶
- info(msg)¶
- warning(msg)¶
- error(msg)¶
- createstubs.log¶
- class createstubs.Stubber(path: str = None, firmware_id: str = None)¶
Generate stubs for modules in firmware
- property flat_fwid¶
Turn _fwid from ‘v1.2.3’ into ‘1_2_3’ to be used in filename
- get_obj_attributes(item_instance: object)¶
extract information of the objects members and attributes
- Parameters:
item_instance (object) –
- add_modules(modules)¶
Add additional modules to be exported
- create_all_stubs()¶
Create stubs for all configured modules
- create_module_stub(module_name: str, file_name: str = None) bool ¶
Create a Stub of a single python module
Args: - module_name (str): name of the module to document. This module will be imported. - file_name (Optional[str]): the ‘path/filename.pyi’ to write to. If omitted will be created based on the module name.
- write_object_stub(fp, object_expr: object, obj_name: str, indent: str, in_class: int = 0)¶
Write a module/object stub to an open file. Can be called recursive.
- report_start(filename: str = 'modules.json')¶
Start a report of the modules that have been stubbed “create json with list of exported modules
- Parameters:
filename (str) –
- report_end()¶
- createstubs._build(s)¶
- createstubs.get_boardname() str ¶
Read the board name from the boardname.py file that may have been created upfront
- Return type:
- createstubs.show_help()¶
- createstubs.main()¶