micrOSDevToolKit 2.9.1__py3-none-any.whl → 2.9.6__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.
- micrOS/release_info/micrOS_ReleaseInfo/system_analysis_sum.json +19 -19
- micrOS/source/Common.py +1 -1
- micrOS/source/Config.py +6 -6
- micrOS/source/LM_pacman.py +248 -0
- micrOS/source/LM_rest.py +0 -1
- micrOS/source/LM_robustness.py +2 -2
- micrOS/source/LM_system.py +4 -16
- micrOS/source/LM_telegram.py +95 -61
- micrOS/source/Logger.py +51 -17
- micrOS/source/Notify.py +4 -3
- micrOS/source/Server.py +33 -39
- micrOS/source/Shell.py +72 -74
- micrOS/source/Web.py +22 -23
- micrOS/source/microIO.py +1 -2
- micrOS/source/reset.py +5 -1
- micrOS/source/urequests.py +12 -4
- {micrOSDevToolKit-2.9.1.data → micrOSDevToolKit-2.9.6.data}/scripts/devToolKit.py +3 -2
- {micrOSDevToolKit-2.9.1.dist-info → micrOSDevToolKit-2.9.6.dist-info}/METADATA +1 -1
- {micrOSDevToolKit-2.9.1.dist-info → micrOSDevToolKit-2.9.6.dist-info}/RECORD +57 -54
- toolkit/Gateway.py +2 -2
- toolkit/dashboard_apps/SystemTest.py +14 -12
- toolkit/index.html +4 -4
- toolkit/lib/TerminalColors.py +4 -0
- toolkit/lib/macroScript.py +6 -0
- toolkit/lib/micrOSClient.py +48 -21
- toolkit/lib/micrOSClientHistory.py +122 -0
- toolkit/micrOSlint.py +1 -1
- toolkit/simulator_lib/__pycache__/machine.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/uasyncio.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/uos.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/ussl.cpython-312.pyc +0 -0
- toolkit/simulator_lib/machine.py +4 -0
- toolkit/simulator_lib/node_config.json +1 -1
- toolkit/simulator_lib/uasyncio.py +7 -1
- toolkit/simulator_lib/uos.py +138 -0
- toolkit/socketClient.py +4 -4
- toolkit/workspace/precompiled/Common.mpy +0 -0
- toolkit/workspace/precompiled/Config.mpy +0 -0
- toolkit/workspace/precompiled/Espnow.mpy +0 -0
- toolkit/workspace/precompiled/LM_pacman.py +248 -0
- toolkit/workspace/precompiled/LM_rest.mpy +0 -0
- toolkit/workspace/precompiled/LM_robustness.py +2 -2
- toolkit/workspace/precompiled/LM_system.mpy +0 -0
- toolkit/workspace/precompiled/LM_telegram.mpy +0 -0
- toolkit/workspace/precompiled/Logger.mpy +0 -0
- toolkit/workspace/precompiled/Notify.mpy +0 -0
- toolkit/workspace/precompiled/Server.mpy +0 -0
- toolkit/workspace/precompiled/Shell.mpy +0 -0
- toolkit/workspace/precompiled/Web.mpy +0 -0
- toolkit/workspace/precompiled/_mpy.version +1 -1
- toolkit/workspace/precompiled/microIO.mpy +0 -0
- toolkit/workspace/precompiled/node_config.json +1 -1
- toolkit/workspace/precompiled/reset.mpy +0 -0
- toolkit/workspace/precompiled/urequests.mpy +0 -0
- micrOS/source/LM_lmpacman.py +0 -126
- toolkit/workspace/precompiled/LM_lmpacman.mpy +0 -0
- {micrOSDevToolKit-2.9.1.dist-info → micrOSDevToolKit-2.9.6.dist-info}/LICENSE +0 -0
- {micrOSDevToolKit-2.9.1.dist-info → micrOSDevToolKit-2.9.6.dist-info}/WHEEL +0 -0
- {micrOSDevToolKit-2.9.1.dist-info → micrOSDevToolKit-2.9.6.dist-info}/top_level.txt +0 -0
micrOS/source/LM_lmpacman.py
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
from os import listdir, remove
|
|
2
|
-
from sys import modules
|
|
3
|
-
from Common import socket_stream
|
|
4
|
-
|
|
5
|
-
WEB_EXT = ('html', 'js', 'css')
|
|
6
|
-
|
|
7
|
-
@socket_stream
|
|
8
|
-
def listmods(msgobj=None):
|
|
9
|
-
"""
|
|
10
|
-
Load module package manager
|
|
11
|
-
- list all load modules
|
|
12
|
-
"""
|
|
13
|
-
# Dump available LMs
|
|
14
|
-
msg_buf = []
|
|
15
|
-
for k in (res.replace('LM_', '') for res in listdir()
|
|
16
|
-
if res.startswith('LM_') or res.split('.')[-1] in WEB_EXT):
|
|
17
|
-
if msgobj is None:
|
|
18
|
-
msg_buf.append(f' {k}')
|
|
19
|
-
else:
|
|
20
|
-
msgobj(f' {k}')
|
|
21
|
-
return msg_buf if len(msg_buf) > 0 else ''
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def delmod(mod=None):
|
|
25
|
-
"""
|
|
26
|
-
Module package manager
|
|
27
|
-
:param mod:
|
|
28
|
-
Delete Load Module with full name: module.py or module.mpy
|
|
29
|
-
OR delete any web resource: *.js, *.css, *.html
|
|
30
|
-
"""
|
|
31
|
-
if mod is not None and (mod.endswith('py') or mod.split('.')[-1] in WEB_EXT):
|
|
32
|
-
# LM exception list - system and lmpacman cannot be deleted
|
|
33
|
-
if 'lmpacman.' in mod or 'system.' in mod:
|
|
34
|
-
return f'Load module {mod} is in use, skip delete.'
|
|
35
|
-
try:
|
|
36
|
-
to_remove = mod if mod.split('.')[-1] in WEB_EXT else f'LM_{mod}'
|
|
37
|
-
remove(to_remove)
|
|
38
|
-
return f'Delete module: {mod}'
|
|
39
|
-
except Exception as e:
|
|
40
|
-
return f'Cannot delete: {mod}: {e}'
|
|
41
|
-
return f'Invalid value: {mod}'
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def del_duplicates():
|
|
45
|
-
"""
|
|
46
|
-
Load module package manager (Not just load modules)
|
|
47
|
-
- delete duplicated .mpy and .py resources, keep .mpy resource!
|
|
48
|
-
"""
|
|
49
|
-
msg_buf = []
|
|
50
|
-
py = list((res.split('.')[0] for res in listdir() if res.endswith('.py'))) # Normally smaller list
|
|
51
|
-
mpy = (res.split('.')[0] for res in listdir() if res.endswith('.mpy'))
|
|
52
|
-
for m in mpy:
|
|
53
|
-
# Iterate over mpy resources
|
|
54
|
-
state = True
|
|
55
|
-
if m in py and m != 'main':
|
|
56
|
-
to_delete = f'{m}.py'
|
|
57
|
-
try:
|
|
58
|
-
remove(to_delete)
|
|
59
|
-
except:
|
|
60
|
-
state = False
|
|
61
|
-
msg_buf.append(f' Delete {to_delete} {state}')
|
|
62
|
-
return '\n'.join(msg_buf) if len(msg_buf) > 0 else 'Nothing to delete.'
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
def module(unload=None):
|
|
66
|
-
"""
|
|
67
|
-
List / unload loaded upython Load Modules
|
|
68
|
-
:param unload: module name to unload
|
|
69
|
-
:param unload: None - list active modules
|
|
70
|
-
:return str: verdict
|
|
71
|
-
"""
|
|
72
|
-
if unload is None:
|
|
73
|
-
return list(modules.keys())
|
|
74
|
-
if unload in modules.keys():
|
|
75
|
-
del modules[unload]
|
|
76
|
-
return f"Module unload {unload} done."
|
|
77
|
-
return f"Module unload {unload} failed."
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
@socket_stream
|
|
81
|
-
def cachedump(cdel=None, msgobj=None):
|
|
82
|
-
"""
|
|
83
|
-
Cache system persistent data storage files (.pds)
|
|
84
|
-
"""
|
|
85
|
-
if cdel is None:
|
|
86
|
-
# List pds files aka application cache
|
|
87
|
-
msg_buf = []
|
|
88
|
-
for pds in (_pds for _pds in listdir() if _pds.endswith('.pds')):
|
|
89
|
-
with open(pds, 'r') as f:
|
|
90
|
-
if msgobj is None:
|
|
91
|
-
msg_buf.append(f'{pds}: {f.read()}')
|
|
92
|
-
else:
|
|
93
|
-
msgobj(f'{pds}: {f.read()}')
|
|
94
|
-
return msg_buf if len(msg_buf) > 0 else ''
|
|
95
|
-
# Remove given pds file
|
|
96
|
-
try:
|
|
97
|
-
remove(f'{cdel}.pds')
|
|
98
|
-
return f'{cdel}.pds delete done.'
|
|
99
|
-
except:
|
|
100
|
-
return f'{cdel}.pds not exists'
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
@socket_stream
|
|
104
|
-
def micros_checksum(msgobj=None):
|
|
105
|
-
from hashlib import sha1
|
|
106
|
-
from binascii import hexlify
|
|
107
|
-
from Config import cfgget
|
|
108
|
-
|
|
109
|
-
for f_name in (_pds for _pds in listdir() if _pds.endswith('py')):
|
|
110
|
-
with open(f_name, 'rb') as f:
|
|
111
|
-
cs = hexlify(sha1(f.read()).digest()).decode('utf-8')
|
|
112
|
-
msgobj(f"{cs} {f_name}")
|
|
113
|
-
# GC collect?
|
|
114
|
-
return f"micrOS version: {cfgget('version')}"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
def help(widgets=False):
|
|
118
|
-
"""
|
|
119
|
-
[i] micrOS LM naming convention - built-in help message
|
|
120
|
-
:return tuple:
|
|
121
|
-
(widgets=False) list of functions implemented by this application
|
|
122
|
-
(widgets=True) list of widget json for UI generation
|
|
123
|
-
"""
|
|
124
|
-
return 'listmods', 'delmod mod=<module>.py/.mpy or .js/.html/.css', 'del_duplicates',\
|
|
125
|
-
'module unload="LM_rgb/None"',\
|
|
126
|
-
'cachedump cdel="rgb.pds/None"', 'micros_checksum'
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|