micropython-stubber 1.17.6__py3-none-any.whl → 1.20.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {micropython_stubber-1.17.6.dist-info → micropython_stubber-1.20.0.dist-info}/METADATA +7 -6
- micropython_stubber-1.20.0.dist-info/RECORD +147 -0
- mpflash/README.md +18 -2
- mpflash/libusb_flash.ipynb +203 -0
- mpflash/mpflash/ask_input.py +234 -0
- mpflash/mpflash/cli_download.py +107 -0
- mpflash/mpflash/cli_flash.py +170 -0
- mpflash/mpflash/cli_group.py +40 -7
- mpflash/mpflash/cli_list.py +41 -0
- mpflash/mpflash/cli_main.py +13 -8
- mpflash/mpflash/common.py +33 -121
- mpflash/mpflash/config.py +9 -0
- mpflash/mpflash/{downloader.py → download.py} +110 -96
- mpflash/mpflash/downloaded.py +108 -0
- mpflash/mpflash/errors.py +5 -0
- mpflash/mpflash/flash.py +69 -0
- mpflash/mpflash/flash_esp.py +17 -23
- mpflash/mpflash/flash_stm32.py +16 -113
- mpflash/mpflash/flash_stm32_cube.py +111 -0
- mpflash/mpflash/flash_stm32_dfu.py +101 -0
- mpflash/mpflash/flash_uf2.py +8 -8
- mpflash/mpflash/flash_uf2_linux.py +13 -6
- mpflash/mpflash/flash_uf2_windows.py +24 -12
- mpflash/mpflash/list.py +56 -39
- mpflash/mpflash/logger.py +12 -13
- mpflash/mpflash/mpboard_id/__init__.py +96 -0
- mpflash/mpflash/mpboard_id/board_id.py +63 -0
- mpflash/mpflash/mpboard_id/board_info.csv +2213 -0
- mpflash/mpflash/mpboard_id/board_info.json +19910 -0
- mpflash/mpflash/mpremoteboard/__init__.py +209 -0
- mpflash/mpflash/mpremoteboard/mpy_fw_info.py +141 -0
- {stubber/bulk → mpflash/mpflash/mpremoteboard}/runner.py +19 -4
- mpflash/mpflash/vendor/dfu.py +164 -0
- mpflash/mpflash/vendor/pydfu.py +605 -0
- mpflash/mpflash/vendor/readme.md +3 -0
- mpflash/mpflash/vendor/versions.py +113 -0
- mpflash/mpflash/worklist.py +147 -0
- mpflash/poetry.lock +427 -610
- mpflash/pyproject.toml +22 -6
- mpflash/stm32_udev_rules.md +63 -0
- stubber/__init__.py +1 -1
- stubber/basicgit.py +1 -0
- stubber/board/createstubs.py +11 -4
- stubber/board/createstubs_db.py +11 -5
- stubber/board/createstubs_db_min.py +61 -58
- stubber/board/createstubs_db_mpy.mpy +0 -0
- stubber/board/createstubs_mem.py +11 -5
- stubber/board/createstubs_mem_min.py +56 -53
- stubber/board/createstubs_mem_mpy.mpy +0 -0
- stubber/board/createstubs_min.py +54 -51
- stubber/board/createstubs_mpy.mpy +0 -0
- stubber/board/modulelist.txt +1 -0
- stubber/bulk/mcu_stubber.py +9 -5
- stubber/codemod/_partials/db_main.py +14 -25
- stubber/codemod/_partials/lvgl_main.py +2 -2
- stubber/codemod/board.py +10 -3
- stubber/commands/clone_cmd.py +7 -7
- stubber/commands/config_cmd.py +3 -0
- stubber/commands/{mcu_cmd.py → get_mcu_cmd.py} +20 -3
- stubber/freeze/get_frozen.py +0 -2
- stubber/publish/candidates.py +1 -1
- stubber/publish/package.py +1 -1
- stubber/publish/pathnames.py +1 -1
- stubber/publish/stubpackage.py +1 -0
- stubber/rst/lookup.py +1 -1
- stubber/stubber.py +1 -9
- stubber/tools/manifestfile.py +5 -3
- stubber/update_fallback.py +104 -104
- stubber/utils/config.py +32 -36
- stubber/utils/repos.py +2 -2
- stubber/utils/versions.py +1 -0
- micropython_stubber-1.17.6.dist-info/RECORD +0 -132
- mpflash/mpflash/flasher.py +0 -276
- stubber/bulk/board_id.py +0 -40
- stubber/bulk/mpremoteboard.py +0 -141
- stubber/commands/get_lobo_cmd.py +0 -58
- stubber/commands/minify_cmd.py +0 -60
- stubber/commands/upd_fallback_cmd.py +0 -36
- stubber/commands/upd_module_list_cmd.py +0 -18
- {micropython_stubber-1.17.6.dist-info → micropython_stubber-1.20.0.dist-info}/LICENSE +0 -0
- {micropython_stubber-1.17.6.dist-info → micropython_stubber-1.20.0.dist-info}/WHEEL +0 -0
- {micropython_stubber-1.17.6.dist-info → micropython_stubber-1.20.0.dist-info}/entry_points.txt +0 -0
- /mpflash/mpflash/{uf2_boardid.py → flash_uf2_boardid.py} +0 -0
@@ -1,132 +0,0 @@
|
|
1
|
-
mpflash/mpflash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
mpflash/mpflash/cli_group.py,sha256=oWgZlUoXY_Wc9-XMXxuxH3F0TevYNafsFWpRtT_WiiU,1228
|
3
|
-
mpflash/mpflash/cli_main.py,sha256=nLFfR-ti_stLVvgwDRsNXgaQ43gQVZUOz_xvRERPuy0,494
|
4
|
-
mpflash/mpflash/common.py,sha256=RBNfbojPKLK3_cxLFIvtHWy8UZUbBxN0ogBN0nliVR4,3896
|
5
|
-
mpflash/mpflash/config.py,sha256=R_sYZ_UwzIc9H2vhwIU5RSDhpcV3fHIX83FEURWOd5E,160
|
6
|
-
mpflash/mpflash/downloader.py,sha256=QVtgocj4b-c9ZunzEZnsyhEZu_Lbk8Hk-43qWBMJ0AI,9783
|
7
|
-
mpflash/mpflash/flash_esp.py,sha256=XffVg1BKzaQo4pzSJdUoHmHa7h4s4gBlNQR50ahGJ1E,2301
|
8
|
-
mpflash/mpflash/flash_stm32.py,sha256=Pn1y9rKw48D0khucT8yU3NjFkHQ9YYTvwco9ir4MmpQ,3742
|
9
|
-
mpflash/mpflash/flash_uf2.py,sha256=8rZRqdi3Rtp8UsHxKgmoMfZ1yBXZbMFXcOeyVVMmX5w,2029
|
10
|
-
mpflash/mpflash/flash_uf2_linux.py,sha256=wXtpqFan6x5k8h2bwwLqwY-LKbpyTg7n2SbD4eb6yH0,4012
|
11
|
-
mpflash/mpflash/flash_uf2_windows.py,sha256=AiFg5jrSyEMX2QxC2sgfn8GekKBw-fPkIi8emlU7Z7o,711
|
12
|
-
mpflash/mpflash/flasher.py,sha256=J7-bsrfQ0MPEKrnUx47q0OqAS61roLBaETu4nv4MfMU,9400
|
13
|
-
mpflash/mpflash/list.py,sha256=7GpZEK7fh6GCzgUdRLHGp8FMEeCbLstV-2u3ohaRYsc,1970
|
14
|
-
mpflash/mpflash/logger.py,sha256=FvGQSR2l4O9nmJV0rKbyoeJDd7fbY2vKQTmPEED0h6s,1048
|
15
|
-
mpflash/mpflash/uf2_boardid.py,sha256=WZKucGu_hJ8ymb236uuZbiR6pD6AA_l4LA-7LwtQhq8,414
|
16
|
-
mpflash/poetry.lock,sha256=1Gf00ycWFfkHFFmLFDnL8ov7GhZPz0qYv-k2S91s-xo,137771
|
17
|
-
mpflash/pyproject.toml,sha256=vffY5dhFWQLUllZl_-f5YFfSsmYwvBN8DakysierFOA,1247
|
18
|
-
mpflash/README.md,sha256=B25tOMF5eyZ3ych_6pfTWRc6cJxwNPXbw7F2QMfJt8A,11455
|
19
|
-
stubber/__init__.py,sha256=b_G4a0TzIG3P--Gsh1qzZaXiera0wZdKQDeZvPTSECM,49
|
20
|
-
stubber/basicgit.py,sha256=5y7eIxmZXfGHwgGrdHtFWTB-tYdgAc7A-0b299wHMYc,9543
|
21
|
-
stubber/board/board_info.csv,sha256=K2VSmfR013fN-oJWkQUmiQ19w09dVwJHDquPy6QmMhY,8627
|
22
|
-
stubber/board/boot.py,sha256=XjWlKErU5nI1HJSugXIP_3hlwgRQboE6sJrpcbSygnk,1120
|
23
|
-
stubber/board/createstubs.py,sha256=4yD2Ixt-E2fUS2Rq3zBrcFKYNr_avNg0pBWQP4HrWgk,32546
|
24
|
-
stubber/board/createstubs_db.py,sha256=pbfa7tNxs0GtjaknCCDPmDqNpukw5DKqqd3UlJNiW2E,30284
|
25
|
-
stubber/board/createstubs_db_min.py,sha256=FxhpNl8iMpH8JNXy8f6i0Ijk_e6rlGiHRv5gVK5HuYM,11424
|
26
|
-
stubber/board/createstubs_db_mpy.mpy,sha256=tedfLsrbARO2mqJrZ-8565wMg4VMq88yB-S_f4xjt0I,9509
|
27
|
-
stubber/board/createstubs_lvgl.py,sha256=CTe7eq1ACRK_JJxavaqDD8znn29nSWJiHHTZ_ps6EhM,27217
|
28
|
-
stubber/board/createstubs_lvgl_min.py,sha256=jLkWYmeboI2A8feMC7pT7cYWttLejQTuX7WAEZCylhw,27207
|
29
|
-
stubber/board/createstubs_lvgl_mpy.mpy,sha256=ex-nlq2V5e8anQBJvRWEEc-FzU7nlwg5NSrZ8vOadIA,9267
|
30
|
-
stubber/board/createstubs_mem.py,sha256=H8RV8p_tI8u2wsxbv4lPUQ-6e5xm0G2fL48s09rk1OY,28618
|
31
|
-
stubber/board/createstubs_mem_min.py,sha256=aJGZFnYhz3nF7R8OZDydOBs1y1RorLDpV6UYpo3ykSg,10970
|
32
|
-
stubber/board/createstubs_mem_mpy.mpy,sha256=SJow8erMqxCCDTkrmy5_O1S-iQy5uXyTosYGEkSpTY8,9091
|
33
|
-
stubber/board/createstubs_min.py,sha256=9s0KTIXVwzD386ECOvVd1MW04bztv1XZd1WbsDtPErs,13509
|
34
|
-
stubber/board/createstubs_mpy.mpy,sha256=YBDgMGamFVTq6HvTsQkAWBi7TxvC0oBEsqVL7IWbB2o,12193
|
35
|
-
stubber/board/fw_info.py,sha256=6AQbN3jtQgllqWQYl4e-63KeEtV08EXk8_JnM6XBkvo,4554
|
36
|
-
stubber/board/info.py,sha256=b7SOPZHVsVhaayKCwVkFZlYu0BW-UFI7LuG1Eop9480,5629
|
37
|
-
stubber/board/main.py,sha256=f6V3tdt6sPZVLuwemT-NLuK9GySfW2c2J6PJMOOWQQw,413
|
38
|
-
stubber/board/modulelist.txt,sha256=UrhmJUkrDaT3-URvVlAoXqOGT7KxfN9BXCM2EcEvpn0,2770
|
39
|
-
stubber/board/pyrightconfig.json,sha256=6oHS4aDOfwKBAFeUPsCGJzEXpUgBZsPaF0M4P-N26D4,1376
|
40
|
-
stubber/bulk/board_id.py,sha256=R37zhRpg9kj3CqDJvPacQdbLq4d9k-Du1e7VUDWrzkI,1531
|
41
|
-
stubber/bulk/mcu_stubber.py,sha256=NvJ8Q8nw09EfUsRg58FOGLldvb3lVIqQ1CHnpIIyeSk,16287
|
42
|
-
stubber/bulk/mpremoteboard.py,sha256=YtaCZBCeS1ZBZrLGI7cVWuM0-0Fyc-hSpxLWofmo0qA,4843
|
43
|
-
stubber/bulk/runner.py,sha256=AQUu8Rhj2jN5-R8F7zHi8pOCv6Z3HE0E0-KIed7QDx4,4159
|
44
|
-
stubber/codemod/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
45
|
-
stubber/codemod/_partials/__init__.py,sha256=4v1lkgSBzFw08gxwujh5sivpbJbYqg5lZeRzgyvN4TE,1561
|
46
|
-
stubber/codemod/_partials/db_main.py,sha256=APeyLDuAc-FNXRQ7ECFVqVPLfOLVyAoLuE83e2Sfg1E,4183
|
47
|
-
stubber/codemod/_partials/lvgl_main.py,sha256=eAZt-nRNg7fxLmqFpt5SDd_IDtcbAY9Xz7QzxwarQSg,1934
|
48
|
-
stubber/codemod/_partials/modules_reader.py,sha256=dJj-H0ncUWVtilSyohQ-dyiUZOjQObds_-llwy_LkYU,2046
|
49
|
-
stubber/codemod/add_comment.py,sha256=CZMjtKO9aarZo1E60QXo80CLJAH05z_ylK6Vvjvb0ls,1965
|
50
|
-
stubber/codemod/add_method.py,sha256=fZH-RGi_pzFpi3tF_0AMDbA9A94dlgXMrc3ItpY3Ylw,2609
|
51
|
-
stubber/codemod/board.py,sha256=RyXX1n8ikEQR8w5FQWBXXE-PD3uyM4woFFMw1rzIJ_8,11756
|
52
|
-
stubber/codemod/enrich.py,sha256=y1qUMnpgMHHgT7hN_Cp5Fmtv3psNAzYM7oHj_bSmT5A,5438
|
53
|
-
stubber/codemod/merge_docstub.py,sha256=0F8_RWVOqwX4PTmxOX0NQrI7rYBkig9n3MHCqkEG5K4,12681
|
54
|
-
stubber/codemod/modify_list.py,sha256=xrpFBKug273D9E02owUheZD418BvsIHIZCFj4YDjTxU,2118
|
55
|
-
stubber/codemod/utils.py,sha256=itARwbMps9UlzMaf4F3wJLJXJvtD-HYq1T1xw96zmR8,2459
|
56
|
-
stubber/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
57
|
-
stubber/commands/build_cmd.py,sha256=a3wW-SLw0HKl3b_7knqoUjMRHbZ14S6oeIQyEnf5-js,2461
|
58
|
-
stubber/commands/cli.py,sha256=pHtViupghgqKMxbyk5_Zz-qHx6i-BGdnTqRO-kngH2E,1850
|
59
|
-
stubber/commands/clone_cmd.py,sha256=Yutrkmt0FYF5XY2XFIbA7iUkFkT6FypDSLby790PMn0,2646
|
60
|
-
stubber/commands/config_cmd.py,sha256=Rmus8FoWtq9_3r6PC2r1rxuY54tar8-MeLiR_kUPkc0,920
|
61
|
-
stubber/commands/enrich_folder_cmd.py,sha256=aGkydAsjyM9LHB99bcjxz_jyDGgOmisZyysbDhZxres,1853
|
62
|
-
stubber/commands/get_core_cmd.py,sha256=oxiDb_r1Ao9N2maeV0EBKosI4nRDNJkDk52xNunYICM,2226
|
63
|
-
stubber/commands/get_docstubs_cmd.py,sha256=xTkuc7k7Od7LUtt_ZohoHaRuE6qhQ80ST0b0ZHKMJrM,2824
|
64
|
-
stubber/commands/get_frozen_cmd.py,sha256=LhtWUL6l2kPUcRQBz19ChwTsdzjai4ryf0UBe52Fu48,3812
|
65
|
-
stubber/commands/get_lobo_cmd.py,sha256=ss-MEeaDAAqQhBsvnSPjhQVd9adeJpe-EVR-Xt9iWjU,1516
|
66
|
-
stubber/commands/mcu_cmd.py,sha256=ZwYmqGlm-oiivxRGzE8xjmvW0ChYq4jcArSnCoyae8I,1672
|
67
|
-
stubber/commands/merge_cmd.py,sha256=2gQYxqapVGD8WMBsqRES7xjIS8acu4hTyutr1OANpAo,1673
|
68
|
-
stubber/commands/minify_cmd.py,sha256=HOLZxiGnSXIu_5scstZZJJ1Kwjugk0Jf1bfXPen9Td8,2267
|
69
|
-
stubber/commands/publish_cmd.py,sha256=myvgP7Y-pb-nyrMVMelNmIVHbxeK4g1ZXmQtxASblkk,2910
|
70
|
-
stubber/commands/stub_cmd.py,sha256=St3UlrVdbkddXystDG2NmKLq_1RbE-gNxlE7ShwQwaw,1186
|
71
|
-
stubber/commands/switch_cmd.py,sha256=DM73QU4Vo3ifr01rv-xSmlxp36T20josOt9-cyUWUDU,1796
|
72
|
-
stubber/commands/upd_fallback_cmd.py,sha256=5d6lIFa1mTo-2O-gDZKwHOZAo5bvX5mp4iaTIfBSaQc,1056
|
73
|
-
stubber/commands/upd_module_list_cmd.py,sha256=drtjqS2aMd0aM-JJdnyl4jcnbq135lfSVcgK_6eovBk,499
|
74
|
-
stubber/commands/variants_cmd.py,sha256=QDm-KtDFIa9_Jl21vjArrW7OrToR8VfwK22pRo0e6CE,1284
|
75
|
-
stubber/cst_transformer.py,sha256=XbvGTUmhhFWW_Ig8Pu6lFdkBS_NCEmJ1oQQm4H1XSrM,6479
|
76
|
-
stubber/data/board_info.csv,sha256=K2VSmfR013fN-oJWkQUmiQ19w09dVwJHDquPy6QmMhY,8627
|
77
|
-
stubber/data/board_info.json,sha256=jyvBN5seoxx7Z7B3UpvMn7H8xWCpmG4VtFSPb8PjmZI,58939
|
78
|
-
stubber/data/micropython_tags.csv,sha256=HQnzPN7jLmgKX3QvobsPMZa-xMb0exglriFziBjaRz8,1909
|
79
|
-
stubber/data/requirements-core-micropython.txt,sha256=6RQWWbLh8YVcD_l1-hjg6wX_Fm1LmNEwy5NExKJIkeg,1317
|
80
|
-
stubber/data/requirements-core-pycopy.txt,sha256=tW71l6FIuoQY1tuxkDgeN4Uw8IIp0YrlhhaaqSGSOA8,1051
|
81
|
-
stubber/downloader.py,sha256=UbrvPg8xaX5xcdAaFUe2pdDBor5clyTl3yzh7r7FLdc,1206
|
82
|
-
stubber/freeze/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
83
|
-
stubber/freeze/common.py,sha256=fydpiBQvwwBM-Uib12NG1k51Pm5gUmPa19UFj6ZTD5E,2639
|
84
|
-
stubber/freeze/freeze_folder.py,sha256=9jLa6M1Uie6MOBnXezrrBYkM9sq4Ja6bz7RGsFpIZJw,2491
|
85
|
-
stubber/freeze/freeze_manifest_2.py,sha256=djruxIe8DkkYq9FM4Zj4VQg-UmG8kcYbRiIWIbqgZGk,4061
|
86
|
-
stubber/freeze/get_frozen.py,sha256=u8g47WSQ14ePDEwKJ4rjj0KnweyQSYgpWZQM9X0ijyw,5374
|
87
|
-
stubber/get_cpython.py,sha256=1YR8QxJq32yI_ZvUVWdNwiTxw2X5F4xdUgCxCFheEpw,3784
|
88
|
-
stubber/get_lobo.py,sha256=jyysWbeEwNuZZtkTudJP1QbyVvh-TwFom5cE7iCi9lE,1776
|
89
|
-
stubber/minify.py,sha256=QC5TbyNH7xJRauo8IMJgMnKGocqdjEXGb6YQgBvMTTA,15026
|
90
|
-
stubber/publish/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
91
|
-
stubber/publish/bump.py,sha256=qSb1DpaIxgyoH3YcPU1XKyDKgqkomxSm0WWf1sAVh0Y,3262
|
92
|
-
stubber/publish/candidates.py,sha256=m7z1USOGPHWULv1yq6JYDy16DFTMQK7ceJzADKs0XtM,11555
|
93
|
-
stubber/publish/database.py,sha256=CLy5oiLasA-YzTTXi9d01qLAyk7NpugCDUOa5R9Ac2g,623
|
94
|
-
stubber/publish/defaults.py,sha256=-Ey04lflKVnT0xO8r8AGliQSdtek9Dm_LDjpwvAnAVk,1636
|
95
|
-
stubber/publish/enums.py,sha256=55TrwB7zlbCeXE3EdC4CCVmhRFlie-DlTqFuaAg-qXo,944
|
96
|
-
stubber/publish/helpers.py,sha256=909umfKUHBMBoVnAanop1vKx8loCrWntlfiiG6z89lY,716
|
97
|
-
stubber/publish/merge_docstubs.py,sha256=bo35onpFgcmcqExKSbpbZKprVs2D_feSy0awNZ09a7A,5319
|
98
|
-
stubber/publish/missing_class_methods.py,sha256=i_tPnGpEpmu53N3exPCrwR1HprxxBpgHgLAZSwJCb4o,1823
|
99
|
-
stubber/publish/package.py,sha256=751NKo67Kq-2vUDWabWqw2eXTntay_BZ6d1vIIE1sX8,6333
|
100
|
-
stubber/publish/pathnames.py,sha256=jTLM7Iy8TvSKPvl1cUlsTxzRNO724wD0XrmEtLQ1pO0,1817
|
101
|
-
stubber/publish/publish.py,sha256=4CTI3n2DDU8QnrSiaDT2SAqk73tlziPLE4cLt8saDrk,3698
|
102
|
-
stubber/publish/pypi.py,sha256=Mu1F7Xx4e0NPWK1_Erck6QGEfdY8w67EBeWFi6JiAzk,1240
|
103
|
-
stubber/publish/stubpackage.py,sha256=5YrIXTd775fRcKb1s95lVbdmFBdI8zwSI2LI-rO9roQ,44676
|
104
|
-
stubber/rst/__init__.py,sha256=5VcbDCotIICa2xnJDs_gw2sFXpjjGOZZbwCrNKXy1OE,293
|
105
|
-
stubber/rst/classsort.py,sha256=YCmF4QEYXqZ1Yu2FZb1iPQBrVkq-mrZaBaRcSUlC7ZE,2655
|
106
|
-
stubber/rst/lookup.py,sha256=Wf0isscGKBbxFLEglkSH5C3QLnUL8NL_lgeQPhW7AOA,20155
|
107
|
-
stubber/rst/output_dict.py,sha256=cpBXRtUD-uh0EgjWIBiRrMLBmIAEXjoJFSOAg-qJQiU,14755
|
108
|
-
stubber/rst/reader.py,sha256=ZR2vrB0xup7qY2zAC6HKKytaiQjlUdr-gxFGamkSfHQ,33382
|
109
|
-
stubber/rst/report_return.py,sha256=WZJSbgjsjxFeCeY-vLms56gv_x3TubaGXGQ8--d8RqI,2814
|
110
|
-
stubber/rst/rst_utils.py,sha256=q4MCmhCeI0fnx6KNVdgz1nE4_hAK4T-F7oAMBnmwZ4w,17817
|
111
|
-
stubber/stubber.py,sha256=OAGcdE_Mcftx5VHN8ZeuZCgpghI1_CxPMoFSIQiijcg,2081
|
112
|
-
stubber/stubs_from_docs.py,sha256=34hHae5zWjlFyO0lXhEjyV2IyuX4akwO1VNb01ylcLY,2833
|
113
|
-
stubber/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
114
|
-
stubber/tools/manifestfile.py,sha256=O8jYChw8wJyIeUb5NOoC5wbgH2zUMSCff3-KvQKGv8M,23715
|
115
|
-
stubber/tools/readme.md,sha256=kH7dA2Rs4BLCXa2ILoTDIj3sJHcGYtDPntyxVIOXvtI,199
|
116
|
-
stubber/update_fallback.py,sha256=TMmNr9fGUaxOfgDNPm2iq6wcLpa-m8ijrpnRohbudPI,4713
|
117
|
-
stubber/update_module_list.py,sha256=QJ-c2K1Wf2SQdpMeGvlVabasKqsN9ZQV4ye5PbSpsWE,4640
|
118
|
-
stubber/utils/__init__.py,sha256=nV9FsOZsJ_hXsyUv4j0Qqp-PKycxyIktU9IoLs4kQmQ,225
|
119
|
-
stubber/utils/config.py,sha256=c3wcDsg_kFqnCYyQL2gZSm6H1aVLG2w-betdVvUBhqQ,4881
|
120
|
-
stubber/utils/makeversionhdr.py,sha256=ZRpClirIzNK4saZHPaDuEpXhBRI_Ow_yZOxeNM3D_Ro,1908
|
121
|
-
stubber/utils/manifest.py,sha256=XBYCkxtYVAdUcch1784eHPAXlXfyfjco4WnRXxBHZYA,3273
|
122
|
-
stubber/utils/post.py,sha256=oSFZdoP6JwEeAOvsBo3kTk7l8ff_AVtL2Y4VIjzujlE,2837
|
123
|
-
stubber/utils/repos.py,sha256=Lg_tYoMzAkxrw3xwgPKb6sX53uMN-ACoPP6oMkowob4,5819
|
124
|
-
stubber/utils/stubmaker.py,sha256=qld_Wfm9f4EuzedXlX1Ky0i0BJdR75oOOTha13_ekz0,5238
|
125
|
-
stubber/utils/typed_config_toml.py,sha256=ikifCIZGNhS_uqsfp6IwIpxdtZqbLtywprjWG_Q0y8o,2629
|
126
|
-
stubber/utils/versions.py,sha256=VvADhHG3ZEu5z1mm927Aj18PO1krFvxVXxxwdecRPlY,3756
|
127
|
-
stubber/variants.py,sha256=-o4TgotbKaCcYBdXkutPaBSR1JdxWmOAiuNT1UlahYc,3784
|
128
|
-
micropython_stubber-1.17.6.dist-info/entry_points.txt,sha256=NQi_M36fgq5k6giSuASas3LrpF6CVdkzfvJC0ja73_g,55
|
129
|
-
micropython_stubber-1.17.6.dist-info/LICENSE,sha256=Fx9qrL45ayRXgH6QzttboqZEjKXms0w1t_b_nkOqYCU,1572
|
130
|
-
micropython_stubber-1.17.6.dist-info/METADATA,sha256=vXkIJk9X8j3kkA6jrJzRYWXYeGXoASOg8710O_qwL8s,19029
|
131
|
-
micropython_stubber-1.17.6.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
132
|
-
micropython_stubber-1.17.6.dist-info/RECORD,,
|
mpflash/mpflash/flasher.py
DELETED
@@ -1,276 +0,0 @@
|
|
1
|
-
from pathlib import Path
|
2
|
-
from typing import List, Optional, Tuple
|
3
|
-
|
4
|
-
import jsonlines
|
5
|
-
import rich_click as click
|
6
|
-
from loguru import logger as log
|
7
|
-
|
8
|
-
# TODO: - refactor so that we do not need the entire stubber package
|
9
|
-
from stubber.bulk.mpremoteboard import MPRemoteBoard
|
10
|
-
|
11
|
-
from .cli_group import cli
|
12
|
-
from .common import DEFAULT_FW_PATH, FWInfo, clean_version
|
13
|
-
from .config import config
|
14
|
-
from .flash_esp import flash_esp
|
15
|
-
from .flash_stm32 import flash_stm32
|
16
|
-
from .flash_uf2 import flash_uf2
|
17
|
-
from .list import show_boards
|
18
|
-
|
19
|
-
# #########################################################################################################
|
20
|
-
|
21
|
-
|
22
|
-
def load_firmwares(fw_folder: Path) -> List[FWInfo]:
|
23
|
-
"""Load a list of available firmwares from the jsonl file"""
|
24
|
-
firmwares: List[FWInfo] = []
|
25
|
-
try:
|
26
|
-
with jsonlines.open(fw_folder / "firmware.jsonl") as reader:
|
27
|
-
firmwares.extend(iter(reader))
|
28
|
-
except FileNotFoundError:
|
29
|
-
log.error(f"No firmware.jsonl found in {fw_folder}")
|
30
|
-
# sort by filename
|
31
|
-
firmwares.sort(key=lambda x: x["filename"])
|
32
|
-
return firmwares
|
33
|
-
|
34
|
-
|
35
|
-
def find_firmware(
|
36
|
-
*,
|
37
|
-
board: str,
|
38
|
-
version: str = "",
|
39
|
-
port: str = "",
|
40
|
-
preview: bool = False,
|
41
|
-
variants: bool = False,
|
42
|
-
fw_folder: Optional[Path] = None,
|
43
|
-
trie: int = 1,
|
44
|
-
):
|
45
|
-
# TODO : better path handling
|
46
|
-
fw_folder = fw_folder or DEFAULT_FW_PATH
|
47
|
-
# Use the information in firmwares.jsonl to find the firmware file
|
48
|
-
fw_list = load_firmwares(fw_folder)
|
49
|
-
|
50
|
-
if not fw_list:
|
51
|
-
log.error(f"No firmware files found. Please download the firmware first.")
|
52
|
-
return []
|
53
|
-
# filter by version
|
54
|
-
version = clean_version(version, drop_v=True)
|
55
|
-
if preview or "preview" in version:
|
56
|
-
# never get a preview for an older version
|
57
|
-
fw_list = [fw for fw in fw_list if fw["preview"]]
|
58
|
-
else:
|
59
|
-
fw_list = [fw for fw in fw_list if fw["version"] == version]
|
60
|
-
|
61
|
-
# filter by port
|
62
|
-
if port:
|
63
|
-
fw_list = [fw for fw in fw_list if fw["port"] == port]
|
64
|
-
|
65
|
-
if board:
|
66
|
-
if variants:
|
67
|
-
fw_list = [fw for fw in fw_list if fw["board"] == board]
|
68
|
-
else:
|
69
|
-
# the variant should match exactly the board name
|
70
|
-
fw_list = [fw for fw in fw_list if fw["variant"] == board]
|
71
|
-
|
72
|
-
if not fw_list and trie < 2:
|
73
|
-
board_id = board.replace("_", "-")
|
74
|
-
# ESP board naming conventions have changed by adding a PORT refix
|
75
|
-
if port.startswith("esp") and not board_id.startswith(port.upper()):
|
76
|
-
board_id = f"{port.upper()}_{board_id}"
|
77
|
-
# RP2 board naming conventions have changed by adding a _RPIprefix
|
78
|
-
if port == "rp2" and not board_id.startswith("RPI_"):
|
79
|
-
board_id = f"RPI_{board_id}"
|
80
|
-
|
81
|
-
log.warning(f"Trying to find a firmware for the board {board_id}")
|
82
|
-
fw_list = find_firmware(
|
83
|
-
fw_folder=fw_folder,
|
84
|
-
board=board_id,
|
85
|
-
version=version,
|
86
|
-
port=port,
|
87
|
-
preview=preview,
|
88
|
-
trie=trie + 1,
|
89
|
-
)
|
90
|
-
# hope we have a match now for the board
|
91
|
-
# sort by filename
|
92
|
-
fw_list.sort(key=lambda x: x["filename"])
|
93
|
-
return fw_list
|
94
|
-
|
95
|
-
|
96
|
-
# #########################################################################################################
|
97
|
-
#
|
98
|
-
# #########################################################################################################
|
99
|
-
WorkList = List[Tuple[MPRemoteBoard, FWInfo]]
|
100
|
-
|
101
|
-
|
102
|
-
def auto_update(conn_boards: List[MPRemoteBoard], target_version: str, fw_folder: Path):
|
103
|
-
"""Builds a list of boards to update based on the connected boards and the firmware available"""
|
104
|
-
wl: WorkList = []
|
105
|
-
for mcu in conn_boards:
|
106
|
-
if mcu.family != "micropython":
|
107
|
-
log.warning(f"Skipping {mcu.board} on {mcu.serialport} as it is not a micropython board")
|
108
|
-
continue
|
109
|
-
board_firmwares = find_firmware(
|
110
|
-
fw_folder=fw_folder,
|
111
|
-
board=mcu.board,
|
112
|
-
version=target_version,
|
113
|
-
port=mcu.port,
|
114
|
-
preview="preview" in target_version,
|
115
|
-
)
|
116
|
-
|
117
|
-
if not board_firmwares:
|
118
|
-
log.error(f"No {target_version} firmware found for {mcu.board} on {mcu.serialport}.")
|
119
|
-
continue
|
120
|
-
if len(board_firmwares) > 1:
|
121
|
-
log.debug(f"Multiple {target_version} firmwares found for {mcu.board} on {mcu.serialport}.")
|
122
|
-
# just use the last firmware
|
123
|
-
fw_info = board_firmwares[-1]
|
124
|
-
log.info(f"Found {target_version} firmware {fw_info['filename']} for {mcu.board} on {mcu.serialport}.")
|
125
|
-
wl.append((mcu, fw_info))
|
126
|
-
return wl
|
127
|
-
|
128
|
-
|
129
|
-
# #########################################################################################################
|
130
|
-
# CLI
|
131
|
-
# #########################################################################################################
|
132
|
-
|
133
|
-
|
134
|
-
@cli.command(
|
135
|
-
"flash",
|
136
|
-
short_help="Flash one or all connected MicroPython boards with a specific firmware and version.",
|
137
|
-
)
|
138
|
-
@click.option(
|
139
|
-
"--firmware",
|
140
|
-
"-f",
|
141
|
-
"fw_folder",
|
142
|
-
type=click.Path(exists=True, file_okay=False, dir_okay=True, path_type=Path),
|
143
|
-
default=DEFAULT_FW_PATH,
|
144
|
-
show_default=True,
|
145
|
-
help="The folder to retrieve the firmware from.",
|
146
|
-
)
|
147
|
-
@click.option(
|
148
|
-
"--version",
|
149
|
-
"-v",
|
150
|
-
"target_version",
|
151
|
-
default="stable",
|
152
|
-
show_default=True,
|
153
|
-
help="The version of MicroPython to flash.",
|
154
|
-
metavar="SEMVER, stable or preview",
|
155
|
-
)
|
156
|
-
@click.option(
|
157
|
-
"--serial",
|
158
|
-
"--serial-port",
|
159
|
-
"-s",
|
160
|
-
"serial_port",
|
161
|
-
default="auto",
|
162
|
-
show_default=True,
|
163
|
-
help="Which serial port(s) to flash",
|
164
|
-
metavar="SERIAL_PORT",
|
165
|
-
)
|
166
|
-
@click.option(
|
167
|
-
"--port",
|
168
|
-
"-p",
|
169
|
-
"port",
|
170
|
-
help="The MicroPython port to flash",
|
171
|
-
metavar="PORT",
|
172
|
-
default="",
|
173
|
-
)
|
174
|
-
@click.option(
|
175
|
-
"--board",
|
176
|
-
"-b",
|
177
|
-
"board",
|
178
|
-
help="The MicroPython board ID to flash. if not specified will try to read the BOARD_ID from the connected MCU.",
|
179
|
-
metavar="BOARD_ID",
|
180
|
-
default="",
|
181
|
-
)
|
182
|
-
@click.option(
|
183
|
-
"--erase/--no-erase",
|
184
|
-
default=True,
|
185
|
-
show_default=True,
|
186
|
-
help="""Erase flash before writing new firmware.""",
|
187
|
-
)
|
188
|
-
@click.option(
|
189
|
-
"--preview/--no-preview",
|
190
|
-
default=False,
|
191
|
-
show_default=True,
|
192
|
-
help="""Include preview versions in the download list.""",
|
193
|
-
)
|
194
|
-
def flash_board(
|
195
|
-
target_version: str,
|
196
|
-
fw_folder: Path,
|
197
|
-
serial_port: Optional[str] = None,
|
198
|
-
board: Optional[str] = None,
|
199
|
-
port: Optional[str] = None,
|
200
|
-
variant: Optional[str] = None,
|
201
|
-
erase: bool = False,
|
202
|
-
preview: bool = False,
|
203
|
-
):
|
204
|
-
todo: WorkList = []
|
205
|
-
target_version = clean_version(target_version)
|
206
|
-
# Update all micropython boards to the latest version
|
207
|
-
if target_version and port and board and serial_port:
|
208
|
-
mcu = MPRemoteBoard(serial_port)
|
209
|
-
mcu.port = port
|
210
|
-
mcu.cpu = port if port.startswith("esp") else ""
|
211
|
-
mcu.board = board
|
212
|
-
firmwares = find_firmware(
|
213
|
-
fw_folder=fw_folder,
|
214
|
-
board=board,
|
215
|
-
version=target_version,
|
216
|
-
port=port,
|
217
|
-
preview=preview or "preview" in target_version,
|
218
|
-
)
|
219
|
-
if not firmwares:
|
220
|
-
log.error(f"No firmware found for {port} {board} version {target_version}")
|
221
|
-
return
|
222
|
-
# use the most recent matching firmware
|
223
|
-
todo = [(mcu, firmwares[-1])]
|
224
|
-
elif serial_port:
|
225
|
-
if serial_port == "auto":
|
226
|
-
# update all connected boards
|
227
|
-
conn_boards = [
|
228
|
-
MPRemoteBoard(sp) for sp in MPRemoteBoard.connected_boards() if sp not in config.ignore_ports
|
229
|
-
]
|
230
|
-
else:
|
231
|
-
# just this serial port
|
232
|
-
conn_boards = [MPRemoteBoard(serial_port)]
|
233
|
-
show_boards(conn_boards)
|
234
|
-
todo = auto_update(conn_boards, target_version, fw_folder)
|
235
|
-
|
236
|
-
flashed = []
|
237
|
-
for mcu, fw_info in todo:
|
238
|
-
fw_file = fw_folder / fw_info["filename"] # type: ignore
|
239
|
-
if not fw_file.exists():
|
240
|
-
log.error(f"File {fw_file} does not exist, skipping {mcu.board} on {mcu.serialport}")
|
241
|
-
continue
|
242
|
-
log.info(f"Updating {mcu.board} on {mcu.serialport} to {fw_info['version']}")
|
243
|
-
|
244
|
-
updated = None
|
245
|
-
# try:
|
246
|
-
if mcu.port in ["samd", "rp2"]:
|
247
|
-
updated = flash_uf2(mcu, fw_file=fw_file, erase=erase)
|
248
|
-
elif mcu.port in ["esp32", "esp8266"]:
|
249
|
-
updated = flash_esp(mcu, fw_file=fw_file, erase=erase)
|
250
|
-
elif mcu.port in ["stm32"]:
|
251
|
-
updated = flash_stm32(mcu, fw_file=fw_file, erase=erase)
|
252
|
-
|
253
|
-
if updated:
|
254
|
-
flashed.append(updated)
|
255
|
-
else:
|
256
|
-
log.error(f"Failed to flash {mcu.board} on {mcu.serialport}")
|
257
|
-
|
258
|
-
if flashed:
|
259
|
-
log.info(f"Flashed {len(flashed)} boards")
|
260
|
-
# conn_boards = [
|
261
|
-
# MPRemoteBoard(sp)
|
262
|
-
# for sp in MPRemoteBoard.connected_boards()
|
263
|
-
# if sp not in config.ignore_ports
|
264
|
-
# ]
|
265
|
-
|
266
|
-
show_boards(flashed, title="Connected boards after flashing")
|
267
|
-
|
268
|
-
|
269
|
-
# TODO:
|
270
|
-
# flash from some sort of queue to allow different images to be flashed to the same board
|
271
|
-
# - flash variant 1
|
272
|
-
# - stub variant 1
|
273
|
-
# - flash variant 2
|
274
|
-
# - stub variant 2
|
275
|
-
#
|
276
|
-
# JIT download / download any missing firmwares based on the detected boards
|
stubber/bulk/board_id.py
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Translate board description to board designator
|
3
|
-
"""
|
4
|
-
|
5
|
-
from pathlib import Path
|
6
|
-
from typing import Optional
|
7
|
-
|
8
|
-
###############################################################################################
|
9
|
-
# TODO : make this a bit nicer
|
10
|
-
HERE = Path(__file__).parent
|
11
|
-
###############################################################################################
|
12
|
-
|
13
|
-
|
14
|
-
def find_board_designator(descr: str, short_descr: str, board_info: Optional[Path] = None) -> Optional[str]:
|
15
|
-
"""
|
16
|
-
Find the miropython BOARD designator based on the description in the firmware
|
17
|
-
using the pre-built board_info.csv file
|
18
|
-
"""
|
19
|
-
if not board_info:
|
20
|
-
board_info = HERE / "../data/board_info.csv"
|
21
|
-
if not board_info.exists():
|
22
|
-
raise FileNotFoundError(f"Board info file not found: {board_info}")
|
23
|
-
|
24
|
-
short_hit = ""
|
25
|
-
with open(board_info, "r") as file:
|
26
|
-
while 1:
|
27
|
-
line = file.readline()
|
28
|
-
if not line:
|
29
|
-
break
|
30
|
-
descr_, board_ = line.split(",")[0].strip(), line.split(",")[1].strip()
|
31
|
-
if descr_ == descr:
|
32
|
-
return board_
|
33
|
-
if short_descr and descr_ == short_descr:
|
34
|
-
if "with" in short_descr:
|
35
|
-
# Good enough - no need to trawl the entire file
|
36
|
-
# info["board"] = board_
|
37
|
-
return board_
|
38
|
-
# good enough if not found in the rest of the file (but slow)
|
39
|
-
short_hit = board_
|
40
|
-
return short_hit or None
|
stubber/bulk/mpremoteboard.py
DELETED
@@ -1,141 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Module to run mpremote commands, and retry on failure or timeout
|
3
|
-
"""
|
4
|
-
|
5
|
-
import sys
|
6
|
-
from pathlib import Path
|
7
|
-
from typing import List, Optional, Union
|
8
|
-
|
9
|
-
import serial.tools.list_ports
|
10
|
-
from loguru import logger as log
|
11
|
-
from tenacity import retry, stop_after_attempt, wait_fixed
|
12
|
-
|
13
|
-
from .board_id import find_board_designator
|
14
|
-
from .runner import run
|
15
|
-
from rich.progress import Progress
|
16
|
-
|
17
|
-
###############################################################################################
|
18
|
-
# TODO : make this a bit nicer
|
19
|
-
HERE = Path(__file__).parent
|
20
|
-
|
21
|
-
OK = 0
|
22
|
-
ERROR = -1
|
23
|
-
RETRIES = 3
|
24
|
-
###############################################################################################
|
25
|
-
|
26
|
-
|
27
|
-
class MPRemoteBoard:
|
28
|
-
"""Class to run mpremote commands"""
|
29
|
-
|
30
|
-
def __init__(self, serialport: str = ""):
|
31
|
-
self.serialport = serialport
|
32
|
-
# self.board = ""
|
33
|
-
self.firmware = {}
|
34
|
-
|
35
|
-
self.connected = False
|
36
|
-
self.path: Optional[Path] = None
|
37
|
-
self.family = "micropython"
|
38
|
-
self.description = ""
|
39
|
-
self.version = ""
|
40
|
-
self.port = ""
|
41
|
-
self.board = ""
|
42
|
-
self.cpu = ""
|
43
|
-
self.arch = ""
|
44
|
-
self.mpy = ""
|
45
|
-
self.build = ""
|
46
|
-
|
47
|
-
def __str__(self):
|
48
|
-
return f"MPRemoteBoard({self.serialport}, {self.family} {self.port}, {self.board}, {self.version})"
|
49
|
-
|
50
|
-
@staticmethod
|
51
|
-
def connected_boards():
|
52
|
-
"""Get a list of connected boards"""
|
53
|
-
devices = [p.device for p in serial.tools.list_ports.comports()]
|
54
|
-
return sorted(devices)
|
55
|
-
|
56
|
-
@retry(stop=stop_after_attempt(RETRIES), wait=wait_fixed(1), retry_error_cls=ConnectionError) # type: ignore
|
57
|
-
def get_mcu_info(self, timeout:int=6):
|
58
|
-
rc, result = self.run_command(
|
59
|
-
["run", str(HERE / "../board/fw_info.py")],
|
60
|
-
no_info=True,
|
61
|
-
timeout=timeout,
|
62
|
-
)
|
63
|
-
if rc != OK:
|
64
|
-
raise ConnectionError(f"Failed to get mcu_info for {self.serialport}")
|
65
|
-
# Ok we have the info, now parse it
|
66
|
-
s = result[0].strip()
|
67
|
-
if s.startswith("{") and s.endswith("}"):
|
68
|
-
info = eval(s)
|
69
|
-
self.family = info["family"]
|
70
|
-
self.version = info["version"]
|
71
|
-
self.build = info["build"]
|
72
|
-
self.port = info["port"]
|
73
|
-
self.cpu = info["cpu"]
|
74
|
-
self.arch = info["arch"]
|
75
|
-
self.mpy = info["mpy"]
|
76
|
-
self.description = descr = info["board"]
|
77
|
-
pos = descr.rfind(" with")
|
78
|
-
if pos != -1:
|
79
|
-
short_descr = descr[:pos].strip()
|
80
|
-
else:
|
81
|
-
short_descr = ""
|
82
|
-
if board_name := find_board_designator(descr, short_descr, HERE / "../data/board_info.csv"):
|
83
|
-
self.board = board_name
|
84
|
-
else:
|
85
|
-
self.board = "UNKNOWN"
|
86
|
-
|
87
|
-
def disconnect(self) -> bool:
|
88
|
-
"""Disconnect from a board"""
|
89
|
-
if not self.connected:
|
90
|
-
return True
|
91
|
-
if not self.serialport:
|
92
|
-
log.error("No port connected")
|
93
|
-
self.connected = False
|
94
|
-
return False
|
95
|
-
log.info(f"Disconnecting from {self.serialport}")
|
96
|
-
result = self.run_command(["disconnect"])[0] == OK
|
97
|
-
self.connected = False
|
98
|
-
return result
|
99
|
-
|
100
|
-
@retry(stop=stop_after_attempt(RETRIES), wait=wait_fixed(2))
|
101
|
-
def run_command(
|
102
|
-
self,
|
103
|
-
cmd: Union[str, List[str]],
|
104
|
-
*,
|
105
|
-
log_errors: bool = True,
|
106
|
-
no_info: bool = False,
|
107
|
-
timeout: int = 60,
|
108
|
-
**kwargs,
|
109
|
-
):
|
110
|
-
"""Run mpremote with the given command
|
111
|
-
Parameters
|
112
|
-
----------
|
113
|
-
cmd : Union[str,List[str]]
|
114
|
-
The command to run, either a string or a list of strings
|
115
|
-
check : bool, optional
|
116
|
-
If True, raise an exception if the command fails, by default False
|
117
|
-
Returns
|
118
|
-
-------
|
119
|
-
bool
|
120
|
-
True if the command succeeded, False otherwise
|
121
|
-
"""
|
122
|
-
if isinstance(cmd, str):
|
123
|
-
cmd = cmd.split(" ")
|
124
|
-
prefix = [sys.executable, "-m", "mpremote", "connect", self.serialport] if self.serialport else ["mpremote"]
|
125
|
-
# if connected add resume to keep state between commands
|
126
|
-
if self.connected:
|
127
|
-
prefix += ["resume"]
|
128
|
-
cmd = prefix + cmd
|
129
|
-
log.debug(" ".join(cmd))
|
130
|
-
result = run(cmd, timeout, log_errors, no_info, **kwargs)
|
131
|
-
self.connected = result[0] == OK
|
132
|
-
return result
|
133
|
-
|
134
|
-
@retry(stop=stop_after_attempt(RETRIES), wait=wait_fixed(1))
|
135
|
-
def mip_install(self, name: str) -> bool:
|
136
|
-
"""Install a micropython package"""
|
137
|
-
# install createstubs to the board
|
138
|
-
cmd = ["mip", "install", name]
|
139
|
-
result = self.run_command(cmd)[0] == OK
|
140
|
-
self.connected = True
|
141
|
-
return result
|
stubber/commands/get_lobo_cmd.py
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
get-lobo (frozen)
|
3
|
-
"""
|
4
|
-
|
5
|
-
from pathlib import Path
|
6
|
-
from typing import List
|
7
|
-
|
8
|
-
import click
|
9
|
-
import stubber.get_lobo as get_lobo
|
10
|
-
import stubber.utils as utils
|
11
|
-
from loguru import logger as log
|
12
|
-
from stubber.commands.cli import stubber_cli
|
13
|
-
from stubber.utils.config import CONFIG
|
14
|
-
|
15
|
-
|
16
|
-
@stubber_cli.command(name="get-lobo")
|
17
|
-
@click.option(
|
18
|
-
"--stub-folder",
|
19
|
-
"-stubs",
|
20
|
-
default=CONFIG.stub_path.as_posix(),
|
21
|
-
type=click.Path(exists=True, file_okay=False, dir_okay=True),
|
22
|
-
show_default=True,
|
23
|
-
)
|
24
|
-
@click.option(
|
25
|
-
"--pyi/--no-pyi",
|
26
|
-
default=True,
|
27
|
-
help="Create .pyi files for the (new) frozen modules",
|
28
|
-
show_default=True,
|
29
|
-
)
|
30
|
-
@click.option(
|
31
|
-
"--black/--no-black",
|
32
|
-
default=True,
|
33
|
-
help="Run black on the (new) frozen modules",
|
34
|
-
show_default=True,
|
35
|
-
)
|
36
|
-
def cli_get_lobo(
|
37
|
-
stub_folder: str = CONFIG.stub_path.as_posix(),
|
38
|
-
pyi: bool = True,
|
39
|
-
black: bool = True,
|
40
|
-
):
|
41
|
-
"""
|
42
|
-
Get the frozen stubs for Lobo-esp32.
|
43
|
-
|
44
|
-
"""
|
45
|
-
log.info("Get the frozen modules Loboris v3.2.24")
|
46
|
-
|
47
|
-
stub_paths: List[Path] = []
|
48
|
-
|
49
|
-
family = "loboris"
|
50
|
-
version = "v3.2.24"
|
51
|
-
stub_path = Path(stub_folder) / f"{family}-{utils.clean_version(version, flat=True)}-frozen"
|
52
|
-
stub_paths.append(stub_path)
|
53
|
-
get_lobo.get_frozen(stub_path)
|
54
|
-
stub_paths = [stub_path]
|
55
|
-
|
56
|
-
log.info("::group:: start post processing of retrieved stubs")
|
57
|
-
utils.do_post_processing(stub_paths, stubgen=pyi, black=black, autoflake=True)
|
58
|
-
log.info("::group:: Done")
|