micrOSDevToolKit 2.9.6__py3-none-any.whl → 2.9.7__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.

Potentially problematic release.


This version of micrOSDevToolKit might be problematic. Click here for more details.

@@ -332,6 +332,6 @@
332
332
  ],
333
333
  "core_score": 9.13,
334
334
  "load_score": 8.23,
335
- "version": "2.9.6-0"
335
+ "version": "2.9.7-0"
336
336
  }
337
337
  }
micrOS/source/Shell.py CHANGED
@@ -25,7 +25,7 @@ from Debug import errlog_add
25
25
 
26
26
  class Shell:
27
27
  __slots__ = ['__devfid', '__auth_mode', '__hwuid', '__auth_ok', '__conf_mode']
28
- MICROS_VERSION = '2.9.6-0'
28
+ MICROS_VERSION = '2.9.7-0'
29
29
 
30
30
  def __init__(self):
31
31
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: micrOSDevToolKit
3
- Version: 2.9.6
3
+ Version: 2.9.7
4
4
  Summary: Development and deployment environment for micrOS, the diy micropython automation OS (IoT)
5
5
  Home-page: https://github.com/BxNxM/micrOS
6
6
  Author: Marcell Ban
@@ -32,7 +32,7 @@ micrOS/micropython/esp32s3_spiram_oct-20231005-v1.21.0.bin,sha256=S-sv_QeL_Tylg1
32
32
  micrOS/micropython/esp32s3_spiram_oct-20241129-v1.24.1.bin,sha256=VbOF_F0YeqttkQd2ePTW66Jd34RU8u9ccFfcv8kxO_U,1662672
33
33
  micrOS/micropython/rpi-pico-w-20241129-v1.24.1.uf2,sha256=v4aYIbWaE94_f6DDzBWS-a9L1BzlcdkZwld9R7bOVA4,1727488
34
34
  micrOS/micropython/tinypico-20241129-v1.24.1.bin,sha256=Kf3cr766a5SK99CZy8bwdWjwvAZxls3tBYvaHBsw7ac,1527200
35
- micrOS/release_info/micrOS_ReleaseInfo/system_analysis_sum.json,sha256=HthRfE-WxmLgKR7in-aiiQktnuOv3i_cIXQzvczuFfw,5760
35
+ micrOS/release_info/micrOS_ReleaseInfo/system_analysis_sum.json,sha256=fSrIflxuw3O-V9jgLqIOPA8oqBw9oBbjfE7E_LRqKRo,5760
36
36
  micrOS/source/.DS_Store,sha256=1lFlJ5EFymdzGAUAaI30vcaaLHt3F1LwpG7xILf9jsM,6148
37
37
  micrOS/source/Common.py,sha256=PAdtseGY6QxUM-5elOAcApUv8AwGQ_smsYex0FeV5w8,7937
38
38
  micrOS/source/Config.py,sha256=E3OTMRI1_T94GMADcvG7MKiuGsKsnbLn17KXHcjhqXM,8795
@@ -109,7 +109,7 @@ micrOS/source/Network.py,sha256=wLhAPiRyi376TKJA7tzCQidDBHq-AbZGGp7JabHIyl8,9417
109
109
  micrOS/source/Notify.py,sha256=OhjdDK3Gq9lPlbuM7sV36ZDUKnRg2-gTlAH8KbInLfs,2493
110
110
  micrOS/source/Scheduler.py,sha256=K6fw807UJnOmbfzgeJQGzGbTL4s2sTIB120ZcS5qrLs,9648
111
111
  micrOS/source/Server.py,sha256=P8cGFbh0cJU-raUrFMSLUgMzKs9OddKiIrcBWQyOQt8,16234
112
- micrOS/source/Shell.py,sha256=HcdRu9cmutodL7k7_pQOhLvLuIHpcyoVPyRsK_PbGSk,12389
112
+ micrOS/source/Shell.py,sha256=Blw5VoFqSJmVO5kGJnErkdEdbaxgovv5ymbCaLtXwMI,12389
113
113
  micrOS/source/Tasks.py,sha256=YMYt86TWnUBWa8j1DQjbOavYpktCizzfZXaKXrb6Fmo,22498
114
114
  micrOS/source/Time.py,sha256=96XMJjHCPwQ2qNuBD2Un7FXxzXZNbV1xCQn-RujsggU,6351
115
115
  micrOS/source/Types.py,sha256=3O_Vb1jN92RPtvgbV8ui6_iFzDOD-BUzVXlPB7PgmM4,3507
@@ -127,12 +127,12 @@ micrOS/source/urequests.py,sha256=h4HL4d6Vl_3DHhG_b6lmxBnqrA6YimBs6ai3q6y3JSw,88
127
127
  micrOS/source/ustyle.css,sha256=P-s8ENwAcWoZi5bocrK3_kVzEjaRFKtFvEF6JRh4MBY,1429
128
128
  micrOS/source/uwidgets.js,sha256=BGeUSbNHn6PClgIgIE6QszwQVJ6j7lzgCBwvIX8cYgo,6631
129
129
  micrOS/source/uwidgets_pro.js,sha256=gbkk3SVttEVvDCwde-pJhAh4k7GuCFPdcWNq32pcKPE,3639
130
- micrOSDevToolKit-2.9.6.data/scripts/devToolKit.py,sha256=WuPc3esCEtw9lN20nEsNUh4EaZEnb62GAtxDOFbVugA,10771
130
+ micrOSDevToolKit-2.9.7.data/scripts/devToolKit.py,sha256=WuPc3esCEtw9lN20nEsNUh4EaZEnb62GAtxDOFbVugA,10771
131
131
  toolkit/DevEnvCompile.py,sha256=H19-60ZpHzP30C-wqR5QTzMDHHpWrTk0Uzh--TZHxvw,12148
132
132
  toolkit/DevEnvOTA.py,sha256=OkEtO5cpym-kEgGpE3TQbyZ-nQOzZpGzbFdbgCibe7I,25356
133
133
  toolkit/DevEnvUSB.py,sha256=-Fdigxi8asEJG4npQpvbpgjHhESq0gz0rL6lthRupVA,33848
134
134
  toolkit/Gateway.py,sha256=OSsJYeAmFhNnb1uu2bjLvZzE3A32O7lza8-NxlGr1DQ,25335
135
- toolkit/LM_to_compile.dat,sha256=iLUISab186sbCiiocDllbZhnVnHKK_WAQcAJi7hD0y4,581
135
+ toolkit/LM_to_compile.dat,sha256=TmcSZcPNVtJKWdyMxY1YtHPnqbD6zcI7B7FISbr6as4,579
136
136
  toolkit/MicrOSDevEnv.py,sha256=XqR7ZTPp-M6s36mH7-slwt_gk2ybqd0daX9qOrBqJMw,12922
137
137
  toolkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
138
138
  toolkit/img_stream.html,sha256=ZGyrUgpi-JhMl4euS-TTjwwGrg66a2pGUQCopWiveds,5135
@@ -315,7 +315,7 @@ toolkit/workspace/precompiled/LM_oled.mpy,sha256=z1R9HIWvPGwibNocDrgVwZSgErGv2pt
315
315
  toolkit/workspace/precompiled/LM_oled_sh1106.mpy,sha256=tgnNSB2jkaYjqS7uMSZMqW6Gp9Dtjiv_YgVJAUptxBY,3764
316
316
  toolkit/workspace/precompiled/LM_oled_ui.mpy,sha256=UgY2UQGfXQa5UsrGprRLDylhF0cjN5KFjuNsHV8UMPg,6823
317
317
  toolkit/workspace/precompiled/LM_oledui.mpy,sha256=bSNnW6rlts7KM3YY-dTV34gG5r5zJMYvsqQorPb191E,11555
318
- toolkit/workspace/precompiled/LM_pacman.py,sha256=k_R0X0YGkRc6-NoF5fvqng7lD5RNmV-rsVa-uBcrleE,8227
318
+ toolkit/workspace/precompiled/LM_pacman.mpy,sha256=njOwVrPKOtC4J5kRCtwV8E8hHTTTt7HzqV121HmCsxE,3507
319
319
  toolkit/workspace/precompiled/LM_pet_feeder.py,sha256=ILrozpnq2_ckkVDUROysMWRksKjflsKpIHvgHdvn-JA,2572
320
320
  toolkit/workspace/precompiled/LM_ph_sensor.py,sha256=yj3rvVbxQr16_zpRBZudMW9eNm1pIhqvk4m8f9MWGKU,1364
321
321
  toolkit/workspace/precompiled/LM_presence.mpy,sha256=hi_dZV6SH5JwpxVcO8twEmYtKM1LgRMR258lIWyyssc,2745
@@ -341,7 +341,7 @@ toolkit/workspace/precompiled/Network.mpy,sha256=WtpvhGB2bvEe94dAHV40fpEyk-Fi0D6
341
341
  toolkit/workspace/precompiled/Notify.mpy,sha256=O80dkyGl8iiiEj47Q6iDJuS5mrT8_e6IXfRMN80pMRU,894
342
342
  toolkit/workspace/precompiled/Scheduler.mpy,sha256=ctCj7FfXj5TchPPxe_9dmnTXWN88egtbAnmJ0N9u_1w,2202
343
343
  toolkit/workspace/precompiled/Server.mpy,sha256=dtSXLYpBcdz0DveB_S6nos46h-m6hwlQ-38G-iVQwKQ,4762
344
- toolkit/workspace/precompiled/Shell.mpy,sha256=MsTnawGShS2aXWBPDGE3AL0Dl4ghkI3b-ftR6cZhC9c,4335
344
+ toolkit/workspace/precompiled/Shell.mpy,sha256=9PXOGm3xKlWqNZ9pzts35VlMAVBIigLv0aIpwxDmMRw,4335
345
345
  toolkit/workspace/precompiled/Tasks.mpy,sha256=vL3tDV7Us3Wg7qtZA8ovqEsvLndOmu14GHcZF2_DtrY,6253
346
346
  toolkit/workspace/precompiled/Time.mpy,sha256=D6jvLP5tUKQdJGcn6Q4-ru-p0at6hnxfLC5bqC78gv0,2756
347
347
  toolkit/workspace/precompiled/Types.mpy,sha256=LssRbPgvsWuR4d2m3R7VMIvsnkVp9nN0ltwaY2wGop8,1401
@@ -361,8 +361,8 @@ toolkit/workspace/precompiled/urequests.mpy,sha256=HO-7YqLS_B32z1OEnu1j9GcqlkEY4
361
361
  toolkit/workspace/precompiled/ustyle.css,sha256=P-s8ENwAcWoZi5bocrK3_kVzEjaRFKtFvEF6JRh4MBY,1429
362
362
  toolkit/workspace/precompiled/uwidgets.js,sha256=BGeUSbNHn6PClgIgIE6QszwQVJ6j7lzgCBwvIX8cYgo,6631
363
363
  toolkit/workspace/precompiled/uwidgets_pro.js,sha256=gbkk3SVttEVvDCwde-pJhAh4k7GuCFPdcWNq32pcKPE,3639
364
- micrOSDevToolKit-2.9.6.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
365
- micrOSDevToolKit-2.9.6.dist-info/METADATA,sha256=G30tHnaWp535IgLpVaIK-Sh-yJFpKqeJ-_rfpLxwbEo,53468
366
- micrOSDevToolKit-2.9.6.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
367
- micrOSDevToolKit-2.9.6.dist-info/top_level.txt,sha256=rOGOIXqLBdGZAoDTiLdZ9B_leFB7bMv7YabLwuIc2bc,25
368
- micrOSDevToolKit-2.9.6.dist-info/RECORD,,
364
+ micrOSDevToolKit-2.9.7.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
365
+ micrOSDevToolKit-2.9.7.dist-info/METADATA,sha256=VS0X9mGCJx4P5-sSfKuTmRH9KGC-oPCyAzNIBGCkJQc,53468
366
+ micrOSDevToolKit-2.9.7.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
367
+ micrOSDevToolKit-2.9.7.dist-info/top_level.txt,sha256=rOGOIXqLBdGZAoDTiLdZ9B_leFB7bMv7YabLwuIc2bc,25
368
+ micrOSDevToolKit-2.9.7.dist-info/RECORD,,
toolkit/LM_to_compile.dat CHANGED
@@ -25,7 +25,7 @@ LM_cct.py
25
25
  LM_presence.py
26
26
  LM_telegram.py
27
27
  LM_oled_sh1106.py
28
- LM_lmpacman.py
28
+ LM_pacman.py
29
29
  LM_aht10.py
30
30
  LM_rgbcct.py
31
31
  LM_OV2640.py
Binary file
@@ -1,248 +0,0 @@
1
- from uos import listdir, remove, stat
2
- from sys import modules
3
- from Common import socket_stream
4
-
5
- WEB_EXT = ('html', 'js', 'css')
6
- DATA_TYPES = ('log', 'pds', 'dat')
7
-
8
- def _is_app_resource(path='/'):
9
- if stat(path)[0] & 0x4000: # Dir check
10
- return True, 'd'
11
- file_name = path.split("/")[-1]
12
- if file_name.startswith('LM_') or file_name.split('.')[-1] in WEB_EXT + DATA_TYPES:
13
- return True, 'f'
14
- return False, '?'
15
-
16
-
17
- #############################################
18
- # Safe file system handler functions #
19
- #############################################
20
-
21
- def ls(path="/", content='*', raw=False):
22
- """
23
- Linux like ls command - list app resources and app folders
24
- :param path: path to list, default: /
25
- :param content: content type, default all, f-file, d-dir can be selected
26
- :param raw: keep raw output [(is_app, type), ...]
27
- """
28
- path = path if path.endswith('/') else f"{path}/"
29
- items = []
30
- for item in listdir(path):
31
- is_app, item_type = _is_app_resource(path + item)
32
- if is_app and (content == "*" or item_type == content):
33
- items.append((item_type, item))
34
- if raw:
35
- return items
36
- formatted_output = ""
37
- i = 0
38
- for f in items:
39
- i += 1
40
- spacer = " " * (4 - len(str(i)))
41
- formatted_output += f"{i}{spacer}{f[0]} {f[1]}\n"
42
- return formatted_output
43
-
44
-
45
- def rm(path):
46
- """
47
- Linux like rm command - delete app resources and folders
48
- :param path: app resource name/path, ex.: LM_robustness.py
49
- """
50
- if 'pacman.' in path or 'system.' in path or "/" == path.strip():
51
- return f'Load module {path} is protected, skip delete.'
52
- is_app, item_type = _is_app_resource(path)
53
- if is_app:
54
- remove(path)
55
- return f"Remove: {path} {'dir' if item_type == 'd' else 'file'}"
56
- return f"Invalid path {path}"
57
-
58
-
59
- def dirtree(path="/", raw=False):
60
- """Return only directories from a given path."""
61
- path = path if path.endswith('/') else f"{path}/"
62
- folders = [f"{path}/{item}" for item in listdir(path) if _is_app_resource(f"{path}{item}")[1] == 'd']
63
- folder_contents = {folder:listdir(folder) for folder in folders}
64
- if raw:
65
- return folder_contents
66
- formatted_output = ""
67
- for k, v in folder_contents.items():
68
- formatted_output += f"{k}\n"
69
- for val in v:
70
- formatted_output += f"\t{val}\n"
71
- return formatted_output
72
-
73
-
74
- def download(url=None, package=None):
75
- """
76
- [BETA] Load Module downloader with mip
77
- :param url: github url path, ex. BxNxM/micrOS/master/toolkit/workspace/precompiled/LM_robustness.py
78
- :param package: mip package name or raw url (hack)
79
- """
80
- if url is None and package is None:
81
- return "Nothing to download, url=None package=None"
82
- if package is None:
83
- base_url = "https://raw.githubusercontent.com/"
84
- file_name = url.split("/")[-1]
85
- if not(file_name.endswith("py") and file_name.startswith("LM_")):
86
- return "Invalid file name in url ending, hint: /LM_*.mpy or /LM_*.py"
87
- # Convert GitHub URL to raw content URL
88
- if "github.com" in url and "blob" in url:
89
- url = url.replace("https://github.com/", base_url).replace("/blob", "")
90
- else:
91
- url = f"{base_url}{url}"
92
- else:
93
- url = package
94
- from mip import install
95
- verdict = ""
96
- try:
97
- verdict += f"Install {url}\n"
98
- install(url)
99
- verdict += "\n|- Done"
100
- except Exception as e:
101
- verdict += f"|- Cannot install: {url}\n{e}"
102
- return verdict
103
-
104
-
105
- def del_duplicates():
106
- """
107
- Load module package manager (Not just load modules)
108
- - delete duplicated .mpy and .py resources, keep .mpy resource!
109
- """
110
- msg_buf = []
111
- py = list((res.split('.')[0] for res in listdir() if res.endswith('.py'))) # Normally smaller list
112
- mpy = (res.split('.')[0] for res in listdir() if res.endswith('.mpy'))
113
- for m in mpy:
114
- # Iterate over mpy resources
115
- state = True
116
- if m in py and m != 'main':
117
- to_delete = f'{m}.py'
118
- try:
119
- remove(to_delete)
120
- except:
121
- state = False
122
- msg_buf.append(f' Delete {to_delete} {state}')
123
- return '\n'.join(msg_buf) if len(msg_buf) > 0 else 'Nothing to delete.'
124
-
125
-
126
- def moduls(unload=None):
127
- """
128
- List / unload loaded upython Load Modules
129
- :param unload: module name to unload
130
- :param unload: None - list active modules
131
- :return str: verdict
132
- """
133
- if unload is None:
134
- return list(modules.keys())
135
- if unload in modules.keys():
136
- del modules[unload]
137
- return f"Module unload {unload} done."
138
- return f"Module unload {unload} failed."
139
-
140
-
141
- @socket_stream
142
- def cachedump(delpds=None, msgobj=None):
143
- """
144
- Cache system persistent data storage files (.pds)
145
- :param delpds: cache name to delete
146
- """
147
- if delpds is None:
148
- # List pds files aka application cache
149
- msg_buf = []
150
- for pds in (_pds for _pds in listdir() if _pds.endswith('.pds')):
151
- with open(pds, 'r') as f:
152
- if msgobj is None:
153
- msg_buf.append(f'{pds}: {f.read()}')
154
- else:
155
- msgobj(f'{pds}: {f.read()}')
156
- return msg_buf if len(msg_buf) > 0 else ''
157
- # Remove given pds file
158
- try:
159
- remove(f'{delpds}.pds')
160
- return f'{delpds}.pds delete done.'
161
- except:
162
- return f'{delpds}.pds not exists'
163
-
164
-
165
- def dat_dump():
166
- """
167
- Generic .dat file dump
168
- - logged data from LMs, sensor datat, etc...
169
- """
170
- logs_dir = "/logs/"
171
- dats = (f for f in listdir(logs_dir) if f.endswith('.dat'))
172
- out = {}
173
- for dat in dats:
174
- with open(f"{logs_dir}{dat}", 'r') as f:
175
- out[dat] = f.read()
176
- return out
177
-
178
- #############################################
179
- # Legacy features #
180
- #############################################
181
-
182
-
183
- @socket_stream
184
- def listmods(msgobj=None):
185
- """
186
- Load module package manager
187
- - list all load modules
188
- """
189
- # Dump available LMs
190
- msg_buf = []
191
- for k in (res.replace('LM_', '') for res in listdir("/")
192
- if res.startswith('LM_') or res.split('.')[-1] in WEB_EXT):
193
- if msgobj is None:
194
- msg_buf.append(f' {k}')
195
- else:
196
- msgobj(f' {k}')
197
- return msg_buf if len(msg_buf) > 0 else ''
198
-
199
-
200
- def delmod(mod=None):
201
- """
202
- Module package manager
203
- :param mod:
204
- Delete Load Module with full name: module.py or module.mpy
205
- OR delete any web resource: *.js, *.css, *.html
206
- """
207
- if mod is not None and (mod.endswith('py') or mod.split('.')[-1] in WEB_EXT):
208
- # LM exception list - system and pacman cannot be deleted
209
- if 'pacman.' in mod or 'system.' in mod:
210
- return f'Load module {mod} is in use, skip delete.'
211
- try:
212
- to_remove = mod if mod.split('.')[-1] in WEB_EXT else f'LM_{mod}'
213
- remove(to_remove)
214
- return f'Delete module: {mod}'
215
- except Exception as e:
216
- return f'Cannot delete: {mod}: {e}'
217
- return f'Invalid value: {mod}'
218
-
219
-
220
- @socket_stream
221
- def micros_checksum(msgobj=None):
222
- from hashlib import sha1
223
- from binascii import hexlify
224
- from Config import cfgget
225
-
226
- for f_name in (_pds for _pds in listdir() if _pds.endswith('py')):
227
- with open(f_name, 'rb') as f:
228
- cs = hexlify(sha1(f.read()).digest()).decode('utf-8')
229
- msgobj(f"{cs} {f_name}")
230
- # GC collect?
231
- return f"micrOS version: {cfgget('version')}"
232
-
233
-
234
- def help(widgets=False):
235
- """
236
- [i] micrOS LM naming convention - built-in help message
237
- :return tuple:
238
- (widgets=False) list of functions implemented by this application
239
- (widgets=True) list of widget json for UI generation
240
- """
241
- return ('listmods', 'delmod mod=<module>.py/.mpy or .js/.html/.css', 'del_duplicates',
242
- 'moduls unload="LM_rgb/None"',
243
- 'cachedump delpds="rgb/None"',
244
- 'dat_dump',
245
- 'download url="BxNxM/micrOS/master/toolkit/workspace/precompiled/LM_robustness.py"',
246
- 'micros_checksum',
247
- 'ls path="/" content="*/f/d"',
248
- 'rm <path>', 'dirtree path="/"')