createstubs
¶
Create stubs for (all) modules on a MicroPython board Copyright (c) 2019-2021 Jos Verlinde
Module Contents¶
Classes¶
Generate stubs for modules in firmware |
Functions¶
|
|
|
get --path from cmdline. [unix/win] |
|
runtime test to determine full or micropython |
|
Attributes¶
- createstubs.stubber_version = 1.4.1¶
- createstubs.ENOENT = 2¶
- createstubs.MAX_CLASS_LEVEL = 2¶
- createstubs.resetWDT()¶
- class createstubs.Stubber(path: str = None, firmware_id: str = None)¶
Generate stubs for modules in firmware
- Parameters
path (str) –
firmware_id (str) –
- static _info()¶
collect base information on this runtime
- get_obj_attributes(self, obj: object)¶
extract information of the objects members and attributes
- Parameters
obj (object) –
- add_modules(self, modules: list)¶
Add additional modules to be exported
- Parameters
modules (list) –
- create_all_stubs(self)¶
Create stubs for all configured modules
- create_module_stub(self, module_name: str, file_name: str = None)¶
Create a Stub of a single python module
- Parameters
module_name (str) –
file_name (str) –
- write_object_stub(self, 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.
- Parameters
object_expr (object) –
obj_name (str) –
indent (str) –
in_class (int) –
- property flat_fwid(self)¶
Turn _fwid from ‘v1.2.3’ into ‘1_2_3’ to be used in filename
- clean(self, path: str = None)¶
Remove all files from the stub folder
- Parameters
path (str) –
- report(self, filename: str = 'modules.json')¶
create json with list of exported modules
- Parameters
filename (str) –
- ensure_folder(self, path: str)¶
Create nested folders if needed
- Parameters
path (str) –
- static get_root() str ¶
Determine the root folder of the device
- Return type
str
- createstubs.show_help()¶
- createstubs.read_path() str ¶
get –path from cmdline. [unix/win]
- Return type
str
- createstubs.isMicroPython() bool ¶
runtime test to determine full or micropython
- Return type
bool
- createstubs.main()¶