micropython-stubber 1.14.1__py3-none-any.whl → 1.15.1__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.15.1.dist-info/METADATA +244 -0
- {micropython_stubber-1.14.1.dist-info → micropython_stubber-1.15.1.dist-info}/RECORD +49 -46
- stubber/__init__.py +1 -1
- stubber/basicgit.py +27 -14
- stubber/board/createstubs.py +34 -36
- stubber/board/createstubs_db.py +35 -35
- stubber/board/createstubs_db_min.py +195 -193
- stubber/board/createstubs_db_mpy.mpy +0 -0
- stubber/board/createstubs_info.py +73 -42
- stubber/board/createstubs_lvgl.py +35 -35
- stubber/board/createstubs_lvgl_min.py +88 -87
- stubber/board/createstubs_lvgl_mpy.mpy +0 -0
- stubber/board/createstubs_mem.py +44 -40
- stubber/board/createstubs_mem_min.py +179 -174
- stubber/board/createstubs_mem_mpy.mpy +0 -0
- stubber/board/createstubs_min.py +75 -74
- stubber/board/createstubs_mpy.mpy +0 -0
- stubber/board/info.py +183 -0
- stubber/codemod/enrich.py +28 -16
- stubber/commands/build_cmd.py +3 -3
- stubber/commands/get_core_cmd.py +17 -5
- stubber/commands/get_docstubs_cmd.py +23 -8
- stubber/commands/get_frozen_cmd.py +62 -9
- stubber/commands/get_lobo_cmd.py +13 -3
- stubber/commands/merge_cmd.py +7 -4
- stubber/commands/publish_cmd.py +5 -4
- stubber/commands/stub_cmd.py +2 -1
- stubber/commands/variants_cmd.py +0 -1
- stubber/freeze/common.py +2 -2
- stubber/freeze/freeze_folder.py +1 -1
- stubber/freeze/get_frozen.py +1 -1
- stubber/minify.py +43 -28
- stubber/publish/bump.py +1 -1
- stubber/publish/candidates.py +61 -17
- stubber/publish/defaults.py +44 -0
- stubber/publish/merge_docstubs.py +19 -56
- stubber/publish/package.py +44 -37
- stubber/publish/pathnames.py +51 -0
- stubber/publish/publish.py +5 -4
- stubber/publish/stubpacker.py +55 -33
- stubber/rst/lookup.py +7 -16
- stubber/rst/reader.py +39 -8
- stubber/stubs_from_docs.py +5 -8
- stubber/utils/post.py +34 -40
- stubber/utils/repos.py +32 -17
- stubber/utils/stubmaker.py +22 -14
- micropython_stubber-1.14.1.dist-info/METADATA +0 -217
- {micropython_stubber-1.14.1.dist-info → micropython_stubber-1.15.1.dist-info}/LICENSE +0 -0
- {micropython_stubber-1.14.1.dist-info → micropython_stubber-1.15.1.dist-info}/WHEEL +0 -0
- {micropython_stubber-1.14.1.dist-info → micropython_stubber-1.15.1.dist-info}/entry_points.txt +0 -0
@@ -1,19 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
v='{}/{}'
|
2
|
+
u='method'
|
3
|
+
t='function'
|
4
|
+
s='bool'
|
5
|
+
r='str'
|
6
|
+
q='float'
|
7
|
+
p='int'
|
8
|
+
o='port'
|
9
|
+
n=NameError
|
10
|
+
m=sorted
|
11
|
+
l=NotImplementedError
|
12
12
|
A=',\n'
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
c='dict'
|
14
|
+
b='list'
|
15
|
+
a='tuple'
|
16
|
+
Z='micropython'
|
17
|
+
Y='stubber'
|
18
|
+
X=str
|
17
19
|
W=repr
|
18
20
|
U='_'
|
19
21
|
T=KeyError
|
@@ -26,253 +28,256 @@ N='family'
|
|
26
28
|
M=len
|
27
29
|
L='.'
|
28
30
|
K='board'
|
29
|
-
J=
|
30
|
-
I=
|
31
|
-
H=
|
32
|
-
G=
|
33
|
-
F=None
|
31
|
+
J=AttributeError
|
32
|
+
I=False
|
33
|
+
H='/'
|
34
|
+
G=print
|
34
35
|
E='version'
|
35
|
-
D=
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
D=None
|
37
|
+
F=OSError
|
38
|
+
C=''
|
39
|
+
import gc as B,os,sys
|
40
|
+
from ujson import dumps as d
|
39
41
|
try:from machine import reset
|
40
42
|
except P:pass
|
41
|
-
try:from collections import OrderedDict as
|
42
|
-
except P:from ucollections import OrderedDict as
|
43
|
-
__version__='v1.
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
try:from collections import OrderedDict as e
|
44
|
+
except P:from ucollections import OrderedDict as e
|
45
|
+
__version__='v1.15.1'
|
46
|
+
w=2
|
47
|
+
x=2
|
48
|
+
f=[L,'/lib','/sd/lib','/flash/lib','lib']
|
47
49
|
from time import sleep
|
48
50
|
class Stubber:
|
49
|
-
def __init__(A,path=
|
50
|
-
|
51
|
+
def __init__(A,path=D,firmware_id=D):
|
52
|
+
C=firmware_id
|
51
53
|
try:
|
52
|
-
if os.uname().release=='1.13.0'and os.uname().version<'v1.13-103':raise
|
53
|
-
except
|
54
|
-
A._report=[];A.info=_info();
|
55
|
-
if
|
56
|
-
elif A.info[N]==
|
54
|
+
if os.uname().release=='1.13.0'and os.uname().version<'v1.13-103':raise l('MicroPython 1.13.0 cannot be stubbed')
|
55
|
+
except J:pass
|
56
|
+
A.log=D;A.log=logging.getLogger(Y);A._report=[];A.info=_info();G('Port: {}'.format(A.info[o]));G('Board: {}'.format(A.info[K]));B.collect()
|
57
|
+
if C:A._fwid=C.lower()
|
58
|
+
elif A.info[N]==Z:A._fwid='{family}-{ver}-{port}-{board}'.format(**A.info)
|
57
59
|
else:A._fwid='{family}-{ver}-{port}'.format(**A.info)
|
58
|
-
A._start_free=
|
60
|
+
A._start_free=B.mem_free()
|
59
61
|
if path:
|
60
|
-
if path.endswith(
|
62
|
+
if path.endswith(H):path=path[:-1]
|
61
63
|
else:path=get_root()
|
62
|
-
A.path='{}/stubs/{}'.format(path,A.flat_fwid).replace('//',
|
63
|
-
try:
|
64
|
-
except
|
64
|
+
A.path='{}/stubs/{}'.format(path,A.flat_fwid).replace('//',H)
|
65
|
+
try:g(path+H)
|
66
|
+
except F:G('error creating stub folder {}'.format(path))
|
65
67
|
A.problematic=['upip','upysh','webrepl_setup','http_client','http_client_ssl','http_server','http_server_ssl'];A.excluded=['webrepl','_webrepl','port_diag','example_sub_led.py','example_pub_button.py'];A.modules=[]
|
66
68
|
def get_obj_attributes(L,item_instance):
|
67
|
-
H=item_instance;D=[];
|
69
|
+
H=item_instance;D=[];I=[]
|
68
70
|
for A in Q(H):
|
69
71
|
if A.startswith(U)and not A in L.modules:continue
|
70
72
|
try:
|
71
73
|
E=getattr(H,A)
|
72
74
|
try:F=W(type(E)).split("'")[1]
|
73
|
-
except R:F=
|
74
|
-
if F in{
|
75
|
-
elif F in{
|
75
|
+
except R:F=C
|
76
|
+
if F in{p,q,r,s,a,b,c}:G=1
|
77
|
+
elif F in{t,u}:G=2
|
76
78
|
elif F in'class':G=3
|
77
79
|
else:G=4
|
78
80
|
D.append((A,W(E),W(type(E)),E,G))
|
79
|
-
except
|
81
|
+
except J as K:I.append("Couldn't get attribute '{}' from object '{}', Err: {}".format(A,H,K))
|
80
82
|
except MemoryError as K:sleep(1);reset()
|
81
|
-
D=
|
82
|
-
def add_modules(A,modules):A.modules=
|
83
|
+
D=m([A for A in D if not A[0].startswith('__')],key=lambda x:x[4]);B.collect();return D,I
|
84
|
+
def add_modules(A,modules):A.modules=m(set(A.modules)|set(modules))
|
83
85
|
def create_all_stubs(A):
|
84
|
-
|
85
|
-
for
|
86
|
+
B.collect()
|
87
|
+
for C in A.modules:A.create_one_stub(C)
|
86
88
|
def create_one_stub(A,module_name):
|
87
|
-
|
88
|
-
if
|
89
|
-
if
|
90
|
-
|
91
|
-
try:
|
92
|
-
except
|
93
|
-
|
94
|
-
def create_module_stub(
|
89
|
+
C=module_name
|
90
|
+
if C in A.problematic:return I
|
91
|
+
if C in A.excluded:return I
|
92
|
+
E='{}/{}.py'.format(A.path,C.replace(L,H));B.collect();D=I
|
93
|
+
try:D=A.create_module_stub(C,E)
|
94
|
+
except F:return I
|
95
|
+
B.collect();return D
|
96
|
+
def create_module_stub(J,module_name,file_name=D):
|
95
97
|
E=file_name;A=module_name
|
96
|
-
if E is
|
97
|
-
else:K=E.split(
|
98
|
-
if
|
99
|
-
M=
|
100
|
-
try:M=__import__(A,
|
101
|
-
except P:return
|
102
|
-
|
103
|
-
with S(E,'w')as N:R=
|
104
|
-
|
98
|
+
if E is D:K=A.replace(L,U)+'.py';E=J.path+H+K
|
99
|
+
else:K=E.split(H)[-1]
|
100
|
+
if H in A:A=A.replace(H,L)
|
101
|
+
M=D
|
102
|
+
try:M=__import__(A,D,D,'*');Q=B.mem_free();G('Stub module: {:<25} to file: {:<70} mem:{:>5}'.format(A,K,Q))
|
103
|
+
except P:return I
|
104
|
+
g(E)
|
105
|
+
with S(E,'w')as N:R=X(J.info).replace('OrderedDict(',C).replace('})','}');V='"""\nModule: \'{0}\' on {1}\n"""\n# MCU: {2}\n# Stubber: {3}\n'.format(A,J._fwid,R,__version__);N.write(V);N.write('from typing import Any\nfrom _typeshed import Incomplete\n\n');J.write_object_stub(N,M,A,C)
|
106
|
+
J._report.append('{{"module": "{}", "file": "{}"}}'.format(A,E.replace('\\',H)))
|
105
107
|
if A not in{'os','sys','logging','gc'}:
|
106
108
|
try:del M
|
107
|
-
except (
|
109
|
+
except (F,T):pass
|
108
110
|
try:del sys.modules[A]
|
109
111
|
except T:pass
|
110
|
-
|
112
|
+
B.collect();return O
|
111
113
|
def write_object_stub(L,fp,object_expr,obj_name,indent,in_class=0):
|
112
|
-
d='{0}{1} = {2} # type: {3}\n';
|
114
|
+
d='{0}{1} = {2} # type: {3}\n';Z='bound_method';Y='Incomplete';Q=in_class;P=object_expr;O='Exception';I=fp;D=indent;B.collect()
|
113
115
|
if P in L.problematic:return
|
114
116
|
R,N=L.get_obj_attributes(P)
|
115
|
-
if N:
|
116
|
-
for (
|
117
|
-
if
|
118
|
-
if
|
119
|
-
if
|
120
|
-
U=
|
117
|
+
if N:G(N)
|
118
|
+
for (E,K,H,S,f) in R:
|
119
|
+
if E in['classmethod','staticmethod','BaseException',O]:continue
|
120
|
+
if E[0].isdigit():continue
|
121
|
+
if H=="<class 'type'>"and M(D)<=x*4:
|
122
|
+
U=C;V=E.endswith(O)or E.endswith('Error')or E in['KeyboardInterrupt','StopIteration','SystemExit']
|
121
123
|
if V:U=O
|
122
|
-
A='\n{}class {}({}):\n'.format(E,
|
123
|
-
if V:A+=
|
124
|
-
|
125
|
-
elif any((A in
|
126
|
-
W=
|
124
|
+
A='\n{}class {}({}):\n'.format(D,E,U)
|
125
|
+
if V:A+=D+' ...\n';I.write(A);return
|
126
|
+
I.write(A);L.write_object_stub(I,S,'{0}.{1}'.format(obj_name,E),D+' ',Q+1);A=D+' def __init__(self, *argv, **kwargs) -> None:\n';A+=D+' ...\n\n';I.write(A)
|
127
|
+
elif any((A in H for A in[u,t,'closure'])):
|
128
|
+
W=Y;X=C
|
127
129
|
if Q>0:X='self, '
|
128
|
-
if
|
129
|
-
else:A='{}def {}({}*args, **kwargs) -> {}:\n'.format(E,
|
130
|
-
A+=
|
131
|
-
elif
|
132
|
-
elif
|
133
|
-
|
134
|
-
if
|
135
|
-
elif
|
130
|
+
if Z in H or Z in K:A='{}@classmethod\n'.format(D)+'{}def {}(cls, *args, **kwargs) -> {}:\n'.format(D,E,W)
|
131
|
+
else:A='{}def {}({}*args, **kwargs) -> {}:\n'.format(D,E,X,W)
|
132
|
+
A+=D+' ...\n\n';I.write(A)
|
133
|
+
elif H=="<class 'module'>":0
|
134
|
+
elif H.startswith("<class '"):
|
135
|
+
J=H[8:-2];A=C
|
136
|
+
if J in[r,p,q,s,'bytearray','bytes']:A=d.format(D,E,K,J)
|
137
|
+
elif J in[c,b,a]:e={c:'{}',b:'[]',a:'()'};A=d.format(D,E,e[J],J)
|
136
138
|
else:
|
137
|
-
if
|
138
|
-
A='{0}{1} : {2} ## {3} = {4}\n'.format(E,
|
139
|
-
|
140
|
-
else:
|
139
|
+
if J not in['object','set','frozenset']:J=Y
|
140
|
+
A='{0}{1} : {2} ## {3} = {4}\n'.format(D,E,J,H,K)
|
141
|
+
I.write(A)
|
142
|
+
else:I.write("# all other, type = '{0}'\n".format(H));I.write(D+E+' # type: Incomplete\n')
|
141
143
|
del R;del N
|
142
|
-
try:del
|
143
|
-
except (
|
144
|
+
try:del E,K,H,S
|
145
|
+
except (F,T,n):pass
|
144
146
|
@property
|
145
147
|
def flat_fwid(self):
|
146
148
|
A=self._fwid;B=' .()/\\:$'
|
147
149
|
for C in B:A=A.replace(C,U)
|
148
150
|
return A
|
149
|
-
def clean(B,path=
|
150
|
-
if path is
|
151
|
-
|
151
|
+
def clean(B,path=D):
|
152
|
+
if path is D:path=B.path
|
153
|
+
G('Clean/remove files in folder: {}'.format(path))
|
152
154
|
try:os.stat(path);C=os.listdir(path)
|
153
|
-
except (
|
155
|
+
except (F,J):return
|
154
156
|
for E in C:
|
155
|
-
A=
|
157
|
+
A=v.format(path,E)
|
156
158
|
try:os.remove(A)
|
157
|
-
except
|
159
|
+
except F:
|
158
160
|
try:B.clean(A);os.rmdir(A)
|
159
|
-
except
|
161
|
+
except F:pass
|
160
162
|
def report(A,filename='modules.json'):
|
161
|
-
|
163
|
+
G('Created stubs for {} modules on board {}\nPath: {}'.format(M(A._report),A._fwid,A.path));E=v.format(A.path,filename);B.collect()
|
162
164
|
try:
|
163
|
-
with S(
|
164
|
-
A.write_json_header(
|
165
|
-
for
|
166
|
-
A.write_json_end(
|
167
|
-
|
168
|
-
except
|
169
|
-
def write_json_header(C,f):B='firmware';f.write('{');f.write(
|
165
|
+
with S(E,'w')as C:
|
166
|
+
A.write_json_header(C);D=O
|
167
|
+
for H in A._report:A.write_json_node(C,H,D);D=I
|
168
|
+
A.write_json_end(C)
|
169
|
+
J=A._start_free-B.mem_free()
|
170
|
+
except F:G('Failed to create the report.')
|
171
|
+
def write_json_header(C,f):B='firmware';f.write('{');f.write(d({B:C.info})[1:-1]);f.write(A);f.write(d({Y:{E:__version__},'stubtype':B})[1:-1]);f.write(A);f.write('"modules" :[\n')
|
170
172
|
def write_json_node(B,f,n,first):
|
171
173
|
if not first:f.write(A)
|
172
174
|
f.write(n)
|
173
175
|
def write_json_end(A,f):f.write('\n]}')
|
174
|
-
def
|
176
|
+
def g(path):
|
175
177
|
A=C=0
|
176
178
|
while A!=-1:
|
177
|
-
A=path.find(
|
179
|
+
A=path.find(H,C)
|
178
180
|
if A!=-1:
|
179
181
|
B=path[0]if A==0 else path[:A]
|
180
|
-
try:
|
181
|
-
except
|
182
|
-
if
|
182
|
+
try:I=os.stat(B)
|
183
|
+
except F as D:
|
184
|
+
if D.args[0]==w:
|
183
185
|
try:os.mkdir(B)
|
184
|
-
except
|
186
|
+
except F as E:G('failed to create folder {}'.format(B));raise E
|
185
187
|
C=A+1
|
186
188
|
def V(s):
|
187
189
|
A=' on '
|
188
|
-
if not s:return
|
190
|
+
if not s:return C
|
189
191
|
if A in s:s=s.split(A,1)[0]
|
190
|
-
return s.split('-')[1]if'-'in s else
|
192
|
+
return s.split('-')[1]if'-'in s else C
|
191
193
|
def _info():
|
192
|
-
|
193
|
-
try:A[E]=L.join([
|
194
|
-
except
|
195
|
-
try:W=sys.implementation._machine if'_machine'in Q(sys.implementation)else os.uname().machine;A[K]=W.strip();A[
|
196
|
-
except (
|
197
|
-
|
198
|
-
for
|
199
|
-
if
|
194
|
+
k='ev3-pybricks';j='pycom';g='pycopy';d='GENERIC';c='arch';b='cpu';a='ver';S='with';G='mpy';F='build';A=e({N:sys.implementation.name,E:C,F:C,a:C,o:'stm32'if sys.platform.startswith('pyb')else sys.platform,K:d,b:C,G:C,c:C})
|
195
|
+
try:A[E]=L.join([X(A)for A in sys.implementation.version])
|
196
|
+
except J:pass
|
197
|
+
try:W=sys.implementation._machine if'_machine'in Q(sys.implementation)else os.uname().machine;A[K]=W.strip();A[b]=W.split(S)[1].strip();A[G]=sys.implementation._mpy if'_mpy'in Q(sys.implementation)else sys.implementation.mpy if G in Q(sys.implementation)else C
|
198
|
+
except (J,R):pass
|
199
|
+
B.collect()
|
200
|
+
for I in [A+'/board_info.csv'for A in f]:
|
201
|
+
if i(I):
|
200
202
|
H=A[K].strip()
|
201
|
-
if
|
203
|
+
if h(A,H,I):break
|
202
204
|
if S in H:
|
203
205
|
H=H.split(S)[0].strip()
|
204
|
-
if
|
205
|
-
A[K]=
|
206
|
-
A[K]=A[K].replace(' ',U);
|
206
|
+
if h(A,H,I):break
|
207
|
+
A[K]=d
|
208
|
+
A[K]=A[K].replace(' ',U);B.collect()
|
207
209
|
try:
|
208
|
-
A[
|
209
|
-
if not A[
|
210
|
-
if not A[
|
211
|
-
except (
|
212
|
-
if A[
|
213
|
-
if A[E]==
|
214
|
-
try:
|
215
|
-
except (R,
|
216
|
-
for (
|
217
|
-
try:
|
210
|
+
A[F]=V(os.uname()[3])
|
211
|
+
if not A[F]:A[F]=V(os.uname()[2])
|
212
|
+
if not A[F]and';'in sys.version:A[F]=V(sys.version.split(';')[1])
|
213
|
+
except (J,R):pass
|
214
|
+
if A[F]and M(A[F])>5:A[F]=C
|
215
|
+
if A[E]==C and sys.platform not in('unix','win32'):
|
216
|
+
try:l=os.uname();A[E]=l.release
|
217
|
+
except (R,J,TypeError):pass
|
218
|
+
for (m,n,p) in [(g,g,'const'),(j,j,'FAT'),(k,'pybricks.hubs','EV3Brick')]:
|
219
|
+
try:q=__import__(n,D,D,p);A[N]=m;del q;break
|
218
220
|
except (P,T):pass
|
219
|
-
if A[N]==
|
220
|
-
if A[N]==
|
221
|
+
if A[N]==k:A['release']='2.0.0'
|
222
|
+
if A[N]==Z:
|
221
223
|
if A[E]and A[E].endswith('.0')and A[E]>='1.10.0'and A[E]<='1.19.9':A[E]=A[E][:-2]
|
222
224
|
if G in A and A[G]:
|
223
|
-
O=int(A[G]);Y=[
|
224
|
-
if Y:A[
|
225
|
+
O=int(A[G]);Y=[D,'x86','x64','armv6','armv6m','armv7m','armv7em','armv7emsp','armv7emdp','xtensa','xtensawin'][O>>10]
|
226
|
+
if Y:A[c]=Y
|
225
227
|
A[G]='v{}.{}'.format(O&255,O>>8&3)
|
226
|
-
A[
|
227
|
-
def
|
228
|
+
A[a]=f"v{A[E]}-{A[F]}"if A[F]else f"v{A[E]}";return A
|
229
|
+
def h(info,board_descr,filename):
|
228
230
|
with S(filename,'r')as B:
|
229
231
|
while 1:
|
230
232
|
A=B.readline()
|
231
233
|
if not A:break
|
232
234
|
C,D=A.split(',')[0].strip(),A.split(',')[1].strip()
|
233
235
|
if C==board_descr:info[K]=D;return O
|
234
|
-
return
|
236
|
+
return I
|
235
237
|
def get_root():
|
236
238
|
try:A=os.getcwd()
|
237
|
-
except (
|
239
|
+
except (F,J):A=L
|
238
240
|
B=A
|
239
|
-
for B in [A,'/sd','/flash',
|
241
|
+
for B in [A,'/sd','/flash',H,L]:
|
240
242
|
try:C=os.stat(B);break
|
241
|
-
except
|
243
|
+
except F:continue
|
242
244
|
return B
|
243
|
-
def
|
245
|
+
def i(filename):
|
244
246
|
try:
|
245
247
|
if os.stat(filename)[0]>>14:return O
|
246
|
-
return
|
247
|
-
except
|
248
|
-
def
|
248
|
+
return I
|
249
|
+
except F:return I
|
250
|
+
def j():sys.exit(1)
|
249
251
|
def read_path():
|
250
|
-
path=
|
252
|
+
path=C
|
251
253
|
if M(sys.argv)==3:
|
252
254
|
A=sys.argv[1].lower()
|
253
255
|
if A in('--path','-p'):path=sys.argv[2]
|
254
|
-
else:
|
255
|
-
elif M(sys.argv)==2:
|
256
|
+
else:j()
|
257
|
+
elif M(sys.argv)==2:j()
|
256
258
|
return path
|
257
|
-
def
|
258
|
-
try:A=bytes('abc',encoding='utf8');B=
|
259
|
-
except (
|
259
|
+
def k():
|
260
|
+
try:A=bytes('abc',encoding='utf8');B=k.__module__;return I
|
261
|
+
except (l,J):return O
|
260
262
|
def main():
|
261
|
-
stubber=Stubber(path=read_path());stubber.clean();stubber.modules=[]
|
262
|
-
for
|
263
|
+
E='/modulelist.txt';stubber=Stubber(path=read_path());stubber.clean();stubber.modules=[]
|
264
|
+
for C in f:
|
263
265
|
try:
|
264
|
-
|
265
|
-
|
266
|
+
F=B.mem_free()
|
267
|
+
with S(C+E)as D:
|
268
|
+
G('Debug: List of modules: '+C+E);A=D.readline()
|
269
|
+
while A:
|
266
270
|
A=A.strip()
|
267
271
|
if M(A)>0 and A[0]!='#':stubber.modules.append(A)
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
272
|
+
A=D.readline()
|
273
|
+
B.collect();G('Debug: Used memory to load modulelist.txt: '+X(F-B.mem_free())+' bytes');break
|
274
|
+
except Exception:pass
|
275
|
+
if not stubber.modules:stubber.modules=[Z]
|
276
|
+
B.collect();stubber.create_all_stubs();stubber.report()
|
277
|
+
if __name__=='__main__'or k():
|
278
|
+
try:y=logging.getLogger(Y);logging.basicConfig(level=logging.INFO)
|
279
|
+
except n:pass
|
280
|
+
if not i('no_auto_stubber.txt'):
|
281
|
+
try:B.threshold(4*1024);B.enable()
|
277
282
|
except BaseException:pass
|
278
283
|
main()
|
Binary file
|