mwxlib 0.93.1__py3-none-any.whl → 0.93.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 mwxlib might be problematic. Click here for more details.
- mwx/controls.py +1 -1
- mwx/framework.py +3 -4
- mwx/graphman.py +86 -66
- mwx/matplot2.py +11 -16
- mwx/matplot2g.py +11 -9
- mwx/matplot2lg.py +41 -15
- mwx/nutshell.py +5 -5
- mwx/py/__init__.py +2 -0
- mwx/py/ffmpeg_view.py +257 -0
- mwx/py/fft_view.py +79 -0
- mwx/py/frame_listview.py +283 -0
- mwx/py/line_profile.py +27 -0
- mwx/utilus.py +39 -34
- mwx/wxpdb.py +2 -2
- mwx/wxwil.py +1 -1
- {mwxlib-0.93.1.dist-info → mwxlib-0.93.7.dist-info}/METADATA +1 -1
- mwxlib-0.93.7.dist-info/RECORD +27 -0
- {mwxlib-0.93.1.dist-info → mwxlib-0.93.7.dist-info}/WHEEL +1 -1
- mwxlib-0.93.1.dist-info/RECORD +0 -23
- {mwxlib-0.93.1.dist-info → mwxlib-0.93.7.dist-info}/LICENSE +0 -0
- {mwxlib-0.93.1.dist-info → mwxlib-0.93.7.dist-info}/top_level.txt +0 -0
mwx/py/frame_listview.py
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
#! python3
|
|
2
|
+
"""Property list of buffers.
|
|
3
|
+
"""
|
|
4
|
+
from pprint import pformat
|
|
5
|
+
import wx
|
|
6
|
+
from wx import aui
|
|
7
|
+
from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin
|
|
8
|
+
|
|
9
|
+
from mwx.framework import CtrlInterface, Menu, StatusBar
|
|
10
|
+
from mwx.controls import Icon, Icon2, Clipboard
|
|
11
|
+
from mwx.graphman import Layer
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class CheckList(wx.ListCtrl, ListCtrlAutoWidthMixin, CtrlInterface):
|
|
15
|
+
"""CheckList of Graph buffers.
|
|
16
|
+
|
|
17
|
+
Note:
|
|
18
|
+
list item order = buffer order.
|
|
19
|
+
(リストアイテムとバッファの並び順 0..n は常に一致します)
|
|
20
|
+
"""
|
|
21
|
+
@property
|
|
22
|
+
def selected_items(self):
|
|
23
|
+
return filter(self.IsSelected, range(self.ItemCount))
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def checked_items(self):
|
|
27
|
+
return filter(self.IsItemChecked, range(self.ItemCount))
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def focused_item(self):
|
|
31
|
+
return self.FocusedItem
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def all_items(self):
|
|
35
|
+
rows = range(self.ItemCount)
|
|
36
|
+
cols = range(self.ColumnCount)
|
|
37
|
+
## return [[self.GetItemText(j, k) for k in cols] for j in rows]
|
|
38
|
+
for j in rows:
|
|
39
|
+
yield [self.GetItemText(j, k) for k in cols]
|
|
40
|
+
|
|
41
|
+
def __init__(self, parent, target, **kwargs):
|
|
42
|
+
wx.ListCtrl.__init__(self, parent, size=(400,130),
|
|
43
|
+
style=wx.LC_REPORT|wx.LC_HRULES, **kwargs)
|
|
44
|
+
ListCtrlAutoWidthMixin.__init__(self)
|
|
45
|
+
CtrlInterface.__init__(self)
|
|
46
|
+
|
|
47
|
+
self.EnableCheckBoxes()
|
|
48
|
+
|
|
49
|
+
self.parent = parent
|
|
50
|
+
self.Target = target
|
|
51
|
+
|
|
52
|
+
self.__dir = True
|
|
53
|
+
|
|
54
|
+
_alist = ( # assoc-list of column names
|
|
55
|
+
("id", 42),
|
|
56
|
+
("name", 160),
|
|
57
|
+
("shape", 90),
|
|
58
|
+
("dtype", 60),
|
|
59
|
+
("Mb", 40),
|
|
60
|
+
("unit", 60),
|
|
61
|
+
("annotation", 240),
|
|
62
|
+
)
|
|
63
|
+
for k, (name, w) in enumerate(_alist):
|
|
64
|
+
self.InsertColumn(k, name, width=w)
|
|
65
|
+
|
|
66
|
+
for j, frame in enumerate(self.Target.all_frames):
|
|
67
|
+
self.InsertItem(j, str(j))
|
|
68
|
+
self.UpdateInfo(frame) # update all --> 計算が入ると時間がかかる
|
|
69
|
+
|
|
70
|
+
self.handler.update({
|
|
71
|
+
0 : {
|
|
72
|
+
'Lbutton dblclick' : (0, self.OnShowItems), # -> frame_shown
|
|
73
|
+
'enter pressed' : (0, self.OnShowItems), # -> frame_shown
|
|
74
|
+
'delete pressed' : (0, self.OnRemoveItems), # -> frame_removed/shown
|
|
75
|
+
'f2 pressed' : (0, self.OnEditAnnotation),
|
|
76
|
+
'C-a pressed' : (0, self.OnSelectAllItems),
|
|
77
|
+
'C-o pressed' : (0, self.OnLoadItems),
|
|
78
|
+
'C-s pressed' : (0, self.OnSaveItems),
|
|
79
|
+
'M-up pressed' : (0, self.Target.OnPageUp),
|
|
80
|
+
'M-down pressed' : (0, self.Target.OnPageDown),
|
|
81
|
+
},
|
|
82
|
+
})
|
|
83
|
+
self.handler.clear(0)
|
|
84
|
+
|
|
85
|
+
self.Bind(wx.EVT_LIST_COL_CLICK, self.OnSortItems)
|
|
86
|
+
self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected)
|
|
87
|
+
|
|
88
|
+
self.context = { # bound to the target
|
|
89
|
+
None: {
|
|
90
|
+
'frame_shown' : [ None, self.on_frame_shown ],
|
|
91
|
+
'frame_hidden' : [ None, self.on_frame_hidden ],
|
|
92
|
+
'frame_loaded' : [ None, self.on_frame_loaded ],
|
|
93
|
+
'frame_removed' : [ None, self.on_frames_removed ],
|
|
94
|
+
'frame_modified' : [ None, self.UpdateInfo ],
|
|
95
|
+
'frame_updated' : [ None, self.UpdateInfo ],
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
self.Target.handler.append(self.context)
|
|
99
|
+
|
|
100
|
+
def copy(all=True):
|
|
101
|
+
frames = self.Target.all_frames
|
|
102
|
+
if frames:
|
|
103
|
+
frame = frames[self.focused_item]
|
|
104
|
+
if all:
|
|
105
|
+
text = pformat(frame.attributes, sort_dicts=0)
|
|
106
|
+
else:
|
|
107
|
+
text = "{}\n{}".format(frame.name, frame.annotation)
|
|
108
|
+
Clipboard.write(text)
|
|
109
|
+
|
|
110
|
+
self.menu = [
|
|
111
|
+
(101, "&Edit annotation", "Edit annotation", Icon('pencil'),
|
|
112
|
+
self.OnEditAnnotation),
|
|
113
|
+
(),
|
|
114
|
+
(102, "Copy info", Icon('copy'),
|
|
115
|
+
lambda v: copy(0),
|
|
116
|
+
lambda v: v.Enable(len(list(self.selected_items)))),
|
|
117
|
+
|
|
118
|
+
(103, "Copy ALL data", Icon2('copy', '+'),
|
|
119
|
+
lambda v: copy(),
|
|
120
|
+
lambda v: v.Enable(len(list(self.selected_items)))),
|
|
121
|
+
]
|
|
122
|
+
self.Bind(wx.EVT_CONTEXT_MENU,
|
|
123
|
+
lambda v: Menu.Popup(self, self.menu))
|
|
124
|
+
|
|
125
|
+
def Destroy(self):
|
|
126
|
+
try:
|
|
127
|
+
self.Target.handler.remove(self.context)
|
|
128
|
+
finally:
|
|
129
|
+
return wx.ListCtrl.Destroy(self)
|
|
130
|
+
|
|
131
|
+
def UpdateInfo(self, frame):
|
|
132
|
+
ls = ("{}".format(frame.index),
|
|
133
|
+
"{}".format(frame.name),
|
|
134
|
+
"{}".format(frame.buffer.shape),
|
|
135
|
+
"{}".format(frame.buffer.dtype),
|
|
136
|
+
"{:.1f}".format(frame.buffer.nbytes/1e6),
|
|
137
|
+
"{:g}{}".format(frame.unit, '*' if frame.localunit else ''),
|
|
138
|
+
"{}".format(frame.annotation),
|
|
139
|
+
)
|
|
140
|
+
j = frame.index
|
|
141
|
+
for k, v in enumerate(ls):
|
|
142
|
+
self.SetItem(j, k, v)
|
|
143
|
+
if frame.pathname:
|
|
144
|
+
self.CheckItem(j)
|
|
145
|
+
|
|
146
|
+
def OnShowItems(self, evt):
|
|
147
|
+
self.Target.select(self.focused_item)
|
|
148
|
+
|
|
149
|
+
def OnRemoveItems(self, evt):
|
|
150
|
+
del self.Target[self.selected_items]
|
|
151
|
+
|
|
152
|
+
def OnSortItems(self, evt): #<wx._controls.ListEvent>
|
|
153
|
+
col = evt.Column
|
|
154
|
+
if col == 0: # reverse the first column
|
|
155
|
+
self.__dir = False
|
|
156
|
+
self.__dir = not self.__dir # toggle 0:ascend/1:descend
|
|
157
|
+
|
|
158
|
+
frames = self.Target.all_frames
|
|
159
|
+
if frames:
|
|
160
|
+
def _eval(x):
|
|
161
|
+
try:
|
|
162
|
+
return eval(x[col].replace('*', '')) # localunit* とか
|
|
163
|
+
except Exception:
|
|
164
|
+
return x[col]
|
|
165
|
+
frame = self.Target.frame
|
|
166
|
+
items = sorted(self.all_items, reverse=self.__dir, key=_eval)
|
|
167
|
+
frames[:] = [frames[int(c[0])] for c in items] # sort by new Id of items
|
|
168
|
+
|
|
169
|
+
lc = list(self.checked_items)
|
|
170
|
+
|
|
171
|
+
for j, c in enumerate(items):
|
|
172
|
+
self.Select(j, False)
|
|
173
|
+
self.CheckItem(j, int(c[0]) in lc)
|
|
174
|
+
for k, v in enumerate(c[1:]): # update data except for id(0)
|
|
175
|
+
self.SetItem(j, k+1, v)
|
|
176
|
+
self.Target.select(frame) # invokes [frame_shown] to select the item
|
|
177
|
+
|
|
178
|
+
def OnSelectAllItems(self, evt):
|
|
179
|
+
for j in range(self.ItemCount):
|
|
180
|
+
self.Select(j)
|
|
181
|
+
|
|
182
|
+
def OnLoadItems(self, evt):
|
|
183
|
+
self.parent.parent.import_index(view=self.Target)
|
|
184
|
+
|
|
185
|
+
def OnSaveItems(self, evt):
|
|
186
|
+
frames = self.Target.all_frames
|
|
187
|
+
selected_frames = [frames[j] for j in self.selected_items]
|
|
188
|
+
if selected_frames:
|
|
189
|
+
self.parent.message("Exporting {} frames.".format(len(selected_frames)))
|
|
190
|
+
self.parent.parent.export_index(frames=selected_frames)
|
|
191
|
+
else:
|
|
192
|
+
self.parent.message("No frame selected.")
|
|
193
|
+
|
|
194
|
+
def OnEditAnnotation(self, evt):
|
|
195
|
+
frames = self.Target.all_frames
|
|
196
|
+
if frames:
|
|
197
|
+
frame = frames[self.focused_item]
|
|
198
|
+
with wx.TextEntryDialog(self, frame.name,
|
|
199
|
+
'Enter an annotation', frame.annotation) as dlg:
|
|
200
|
+
if dlg.ShowModal() == wx.ID_OK:
|
|
201
|
+
frame.annotation = dlg.Value
|
|
202
|
+
|
|
203
|
+
def OnItemSelected(self, evt):
|
|
204
|
+
frames = self.Target.all_frames
|
|
205
|
+
frame = frames[evt.Index]
|
|
206
|
+
self.parent.message(frame.pathname)
|
|
207
|
+
evt.Skip()
|
|
208
|
+
|
|
209
|
+
## --------------------------------
|
|
210
|
+
## Actions of frame-handler
|
|
211
|
+
## --------------------------------
|
|
212
|
+
|
|
213
|
+
def on_frame_loaded(self, frame):
|
|
214
|
+
j = frame.index
|
|
215
|
+
self.InsertItem(j, str(j))
|
|
216
|
+
for k in range(j+1, self.ItemCount): # id(0) を更新する
|
|
217
|
+
self.SetItem(k, 0, str(k))
|
|
218
|
+
self.UpdateInfo(frame)
|
|
219
|
+
|
|
220
|
+
def on_frame_shown(self, frame):
|
|
221
|
+
j = frame.index
|
|
222
|
+
self.SetItemFont(j, self.Font.Bold())
|
|
223
|
+
self.Select(j)
|
|
224
|
+
self.Focus(j)
|
|
225
|
+
|
|
226
|
+
def on_frame_hidden(self, frame):
|
|
227
|
+
j = frame.index
|
|
228
|
+
self.SetItemFont(j, self.Font)
|
|
229
|
+
self.Select(j, False)
|
|
230
|
+
|
|
231
|
+
def on_frames_removed(self, indices):
|
|
232
|
+
for j in reversed(indices):
|
|
233
|
+
self.DeleteItem(j)
|
|
234
|
+
for k in range(self.ItemCount): # id(0) を更新する
|
|
235
|
+
self.SetItem(k, 0, str(k))
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
class Plugin(Layer):
|
|
239
|
+
"""Property list of Grpah buffers.
|
|
240
|
+
"""
|
|
241
|
+
menukey = "Plugins/Extensions/&Buffer listbox\tCtrl+b"
|
|
242
|
+
caption = "Property list"
|
|
243
|
+
dockable = False
|
|
244
|
+
|
|
245
|
+
@property
|
|
246
|
+
def all_pages(self):
|
|
247
|
+
return [self.nb.GetPage(i) for i in range(self.nb.PageCount)]
|
|
248
|
+
|
|
249
|
+
@property
|
|
250
|
+
def message(self):
|
|
251
|
+
return self.statusline
|
|
252
|
+
|
|
253
|
+
def Init(self):
|
|
254
|
+
self.nb = aui.AuiNotebook(self, size=(400,150),
|
|
255
|
+
style = (aui.AUI_NB_DEFAULT_STYLE|aui.AUI_NB_RIGHT)
|
|
256
|
+
&~(aui.AUI_NB_CLOSE_ON_ACTIVE_TAB|aui.AUI_NB_MIDDLE_CLICK_CLOSE)
|
|
257
|
+
)
|
|
258
|
+
self.attach(self.graph, "graph")
|
|
259
|
+
self.attach(self.output, "output")
|
|
260
|
+
|
|
261
|
+
self.statusline = StatusBar(self)
|
|
262
|
+
self.layout((
|
|
263
|
+
self.nb,
|
|
264
|
+
(self.statusline, 0, wx.EXPAND),
|
|
265
|
+
),
|
|
266
|
+
expand=2, border=0, vspacing=0,
|
|
267
|
+
)
|
|
268
|
+
|
|
269
|
+
def on_focus_set(v):
|
|
270
|
+
self.parent.select_view(self.nb.CurrentPage.Target)
|
|
271
|
+
v.Skip()
|
|
272
|
+
|
|
273
|
+
self.nb.Bind(wx.EVT_CHILD_FOCUS, on_focus_set)
|
|
274
|
+
|
|
275
|
+
def attach(self, target, caption):
|
|
276
|
+
if target not in [lc.Target for lc in self.all_pages]:
|
|
277
|
+
lc = CheckList(self, target)
|
|
278
|
+
self.nb.AddPage(lc, caption)
|
|
279
|
+
|
|
280
|
+
def detach(self, target):
|
|
281
|
+
for k, lc in enumerate(self.all_pages):
|
|
282
|
+
if target is lc.Target:
|
|
283
|
+
self.nb.DeletePage(k)
|
mwx/py/line_profile.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#! python3
|
|
2
|
+
"""Line profile.
|
|
3
|
+
"""
|
|
4
|
+
from mwx.graphman import Layer
|
|
5
|
+
from mwx.matplot2lg import LineProfile
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Plugin(Layer):
|
|
9
|
+
"""Line profile of the currently selected buffers.
|
|
10
|
+
"""
|
|
11
|
+
menukey = "Plugins/Extensions/&Line profile\tCtrl+l"
|
|
12
|
+
caption = "Line profile"
|
|
13
|
+
dockable = False
|
|
14
|
+
|
|
15
|
+
def Init(self):
|
|
16
|
+
self.plot = LineProfile(self, log=self.message, size=(300,200))
|
|
17
|
+
|
|
18
|
+
self.layout((self.plot,), expand=2, border=0)
|
|
19
|
+
|
|
20
|
+
@self.handler.bind('page_shown')
|
|
21
|
+
def activate(v):
|
|
22
|
+
self.plot.attach(*self.parent.graphic_windows)
|
|
23
|
+
self.plot.linplot(self.parent.selected_view.frame)
|
|
24
|
+
|
|
25
|
+
@self.handler.bind('page_closed')
|
|
26
|
+
def deactivate(v):
|
|
27
|
+
self.plot.detach(*self.parent.graphic_windows)
|
mwx/utilus.py
CHANGED
|
@@ -134,7 +134,7 @@ def apropos(obj, rexpr='', ignorecase=True, alias=None, pred=None, locals=None):
|
|
|
134
134
|
try:
|
|
135
135
|
p = re.compile(rexpr, re.I if ignorecase else 0)
|
|
136
136
|
except re.error as e:
|
|
137
|
-
print("- re:miss compilation
|
|
137
|
+
print("- re:miss compilation:", e)
|
|
138
138
|
else:
|
|
139
139
|
keys = sorted(filter(p.search, dir(obj)), key=lambda s:s.upper())
|
|
140
140
|
n = 0
|
|
@@ -146,10 +146,8 @@ def apropos(obj, rexpr='', ignorecase=True, alias=None, pred=None, locals=None):
|
|
|
146
146
|
word = repr(value)
|
|
147
147
|
word = ' '.join(s.strip() for s in word.splitlines())
|
|
148
148
|
n += 1
|
|
149
|
-
except (TypeError, ValueError):
|
|
150
|
-
continue
|
|
151
149
|
except Exception as e:
|
|
152
|
-
word =
|
|
150
|
+
word = f"#<{e!r}>"
|
|
153
151
|
if len(word) > 80:
|
|
154
152
|
word = word[:80] + '...' # truncate words +3 ellipsis
|
|
155
153
|
print(" {}.{:<36s} {}".format(name, key, word))
|
|
@@ -383,6 +381,22 @@ def _extract_paren_from_tokens(tokens, reverse=False):
|
|
|
383
381
|
return [] # error("unclosed-paren")
|
|
384
382
|
|
|
385
383
|
|
|
384
|
+
def walk_packages_no_import(path=None, prefix=''):
|
|
385
|
+
"""Yields module info recursively for all submodules on path.
|
|
386
|
+
If path is None, yields all top-level modules on sys.path.
|
|
387
|
+
"""
|
|
388
|
+
for info in pkgutil.iter_modules(path, prefix):
|
|
389
|
+
yield info
|
|
390
|
+
if info.ispkg:
|
|
391
|
+
name = info.name.rpartition('.')[2]
|
|
392
|
+
try:
|
|
393
|
+
path = [os.path.join(info.module_finder.path, name)]
|
|
394
|
+
except AttributeError:
|
|
395
|
+
## Actually, it doesn't get here.
|
|
396
|
+
path = [os.path.join(info.module_finder.archive, name)]
|
|
397
|
+
yield from walk_packages_no_import(path, info.name+'.')
|
|
398
|
+
|
|
399
|
+
|
|
386
400
|
def find_modules(force=False, verbose=True):
|
|
387
401
|
"""Find all modules available and write to log file.
|
|
388
402
|
|
|
@@ -393,33 +407,21 @@ def find_modules(force=False, verbose=True):
|
|
|
393
407
|
|
|
394
408
|
def _callback(path, modname, desc=''):
|
|
395
409
|
if verbose:
|
|
396
|
-
print("Scanning {:70s}".format(modname[:70]), end='\r'
|
|
397
|
-
file=sys.__stdout__)
|
|
410
|
+
print("Scanning {:70s}".format(modname[:70]), end='\r')
|
|
398
411
|
lm.append(modname)
|
|
399
412
|
|
|
400
413
|
def _error(modname):
|
|
401
414
|
if verbose:
|
|
402
|
-
print("-
|
|
403
|
-
file=sys.__stderr__)
|
|
415
|
+
print("- Failed: {}".format(modname))
|
|
404
416
|
|
|
405
417
|
if not force and os.path.exists(fn):
|
|
406
418
|
with open(fn, 'r') as o:
|
|
407
419
|
lm = eval(o.read()) # read and evaluate module list
|
|
408
420
|
|
|
409
|
-
## Check additional packages
|
|
421
|
+
## Check additional packages and modules
|
|
410
422
|
verbose = False
|
|
411
|
-
for
|
|
412
|
-
|
|
413
|
-
_callback(None, root.name)
|
|
414
|
-
if root.ispkg:
|
|
415
|
-
try:
|
|
416
|
-
#<FileFinder object>
|
|
417
|
-
path = [os.path.join(root.module_finder.path, root.name)]
|
|
418
|
-
except AttributeError:
|
|
419
|
-
#<zipimporter object> e.g. egg
|
|
420
|
-
path = [os.path.join(root.module_finder.archive, root.name)]
|
|
421
|
-
for info in pkgutil.walk_packages(path, root.name+'.', onerror=_error):
|
|
422
|
-
_callback(None, info.name)
|
|
423
|
+
for info in walk_packages_no_import(['.']):
|
|
424
|
+
_callback('.', info.name)
|
|
423
425
|
else:
|
|
424
426
|
print("Please wait a moment "
|
|
425
427
|
"while Py{} gathers a list of all available modules... "
|
|
@@ -428,6 +430,9 @@ def find_modules(force=False, verbose=True):
|
|
|
428
430
|
lm = list(sys.builtin_module_names)
|
|
429
431
|
|
|
430
432
|
## pydoc.ModuleScanner().run(_callback, key='', onerror=_error)
|
|
433
|
+
|
|
434
|
+
## Note: pkgutil.walk_packages must import all packages (not all modules!)
|
|
435
|
+
## on the given path, in order to access the __path__ attribute.
|
|
431
436
|
for info in pkgutil.walk_packages(onerror=_error):
|
|
432
437
|
_callback(None, info.name)
|
|
433
438
|
|
|
@@ -565,7 +570,7 @@ class FSM(dict):
|
|
|
565
570
|
self.update(contexts)
|
|
566
571
|
|
|
567
572
|
def __missing__(self, key):
|
|
568
|
-
raise Exception("FSM
|
|
573
|
+
raise Exception("FSM logic-error: undefined state {!r}".format(key))
|
|
569
574
|
|
|
570
575
|
def __repr__(self):
|
|
571
576
|
return "<{} object at 0x{:X}>".format(self.__class__.__name__, id(self))
|
|
@@ -657,12 +662,12 @@ class FSM(dict):
|
|
|
657
662
|
except BdbQuit:
|
|
658
663
|
pass
|
|
659
664
|
except Exception as e:
|
|
660
|
-
self.dump("- FSM
|
|
661
|
-
"
|
|
662
|
-
"
|
|
663
|
-
"
|
|
665
|
+
self.dump("- FSM exception: {!r}".format(e),
|
|
666
|
+
" event : {}".format(event),
|
|
667
|
+
" from : {}".format(self.__prev_state),
|
|
668
|
+
" to : {}".format(self.__state),
|
|
664
669
|
" action : {}".format(typename(act)),
|
|
665
|
-
"
|
|
670
|
+
" args : {}".format(args),
|
|
666
671
|
" kwargs : {}".format(kwargs))
|
|
667
672
|
traceback.print_exc()
|
|
668
673
|
self.__matched_pattern = None
|
|
@@ -794,7 +799,7 @@ class FSM(dict):
|
|
|
794
799
|
warnings.warn(msg, stacklevel=3)
|
|
795
800
|
|
|
796
801
|
if state not in self:
|
|
797
|
-
warn("- FSM
|
|
802
|
+
warn("- FSM warning: [{!r}] context newly created.".format(state))
|
|
798
803
|
self[state] = SSM() # new context
|
|
799
804
|
|
|
800
805
|
context = self[state]
|
|
@@ -803,14 +808,14 @@ class FSM(dict):
|
|
|
803
808
|
|
|
804
809
|
if event in context:
|
|
805
810
|
if state2 != context[event][0]:
|
|
806
|
-
warn("- FSM
|
|
811
|
+
warn("- FSM warning: transaction may conflict.\n"
|
|
807
812
|
" The state {2!r} and the original state is not the same."
|
|
808
813
|
" {0!r} : {1!r} --> {2!r}".format(event, state, state2))
|
|
809
814
|
pass
|
|
810
815
|
context[event][0] = state2 # update transition
|
|
811
816
|
else:
|
|
812
817
|
## if state2 not in self:
|
|
813
|
-
## warn("- FSM
|
|
818
|
+
## warn("- FSM warning: transaction may contradict\n"
|
|
814
819
|
## " The state {2!r} is not found in the contexts."
|
|
815
820
|
## " {0!r} : {1!r} --> {2!r}".format(event, state, state2))
|
|
816
821
|
## pass
|
|
@@ -824,7 +829,7 @@ class FSM(dict):
|
|
|
824
829
|
try:
|
|
825
830
|
transaction.append(action)
|
|
826
831
|
except AttributeError:
|
|
827
|
-
warn("- FSM
|
|
832
|
+
warn("- FSM warning: cannot append new transaction ({!r} : {!r})\n"
|
|
828
833
|
" The transaction must be a list, not a tuple".format(state, event))
|
|
829
834
|
return action
|
|
830
835
|
|
|
@@ -842,12 +847,12 @@ class FSM(dict):
|
|
|
842
847
|
warnings.warn(msg, stacklevel=3)
|
|
843
848
|
|
|
844
849
|
if state not in self:
|
|
845
|
-
warn("- FSM
|
|
850
|
+
warn("- FSM warning: [{!r}] context does not exist.".format(state))
|
|
846
851
|
return
|
|
847
852
|
|
|
848
853
|
context = self[state]
|
|
849
854
|
if event not in context:
|
|
850
|
-
warn("- FSM
|
|
855
|
+
warn("- FSM warning: No such transaction ({!r} : {!r})".format(state, event))
|
|
851
856
|
return
|
|
852
857
|
|
|
853
858
|
transaction = context[event]
|
|
@@ -861,7 +866,7 @@ class FSM(dict):
|
|
|
861
866
|
transaction.remove(action)
|
|
862
867
|
return True
|
|
863
868
|
except AttributeError:
|
|
864
|
-
warn("- FSM
|
|
869
|
+
warn("- FSM warning: removing action from context ({!r} : {!r})\n"
|
|
865
870
|
" The transaction must be a list, not a tuple".format(state, event))
|
|
866
871
|
return False
|
|
867
872
|
|
mwx/wxpdb.py
CHANGED
|
@@ -241,7 +241,7 @@ class Debugger(Pdb):
|
|
|
241
241
|
except Exception as e:
|
|
242
242
|
## Note: post-call to avoid crashing by a kill-focus event.
|
|
243
243
|
wx.CallAfter(wx.MessageBox,
|
|
244
|
-
"Debugger is closed.\n\n{}"
|
|
244
|
+
f"Debugger is closed.\n\n{e}")
|
|
245
245
|
finally:
|
|
246
246
|
self.set_quit()
|
|
247
247
|
return
|
|
@@ -268,7 +268,7 @@ class Debugger(Pdb):
|
|
|
268
268
|
except Exception as e:
|
|
269
269
|
## Note: post-call to avoid crashing by a kill-focus event.
|
|
270
270
|
wx.CallAfter(wx.MessageBox,
|
|
271
|
-
"Debugger is closed.\n\n{}"
|
|
271
|
+
f"Debugger is closed.\n\n{e}")
|
|
272
272
|
finally:
|
|
273
273
|
self.set_quit()
|
|
274
274
|
return
|
mwx/wxwil.py
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
mwx/__init__.py,sha256=5B4YSOuijG1Uo5-FLtLHGB52Cp_F4vnN--4wGPBx7do,2398
|
|
2
|
+
mwx/bookshelf.py,sha256=FrissUYdGXLABOzJmMaQU6GXvu6n_9DVW3d5wGwQzjM,6613
|
|
3
|
+
mwx/controls.py,sha256=9C1sXBwQl-oZtCb3rXoT-doW48Sv1J359toNq9ScF9M,47173
|
|
4
|
+
mwx/framework.py,sha256=HiXX52Go64R167S9GiKs1SEbkxx-sMps88VDI9mIw5w,73951
|
|
5
|
+
mwx/graphman.py,sha256=SKYJFxi-TqWOALRczYz-M-2ZYEbqiZuAuKCfEIedctY,70156
|
|
6
|
+
mwx/images.py,sha256=mrnUYH12I3XLVSZcEXlpVltX0XMxufbl2yRvDIQJZqc,49957
|
|
7
|
+
mwx/matplot2.py,sha256=qaF_gvLoLn-TimLbRR59KUavNr1ZpZQdSMqjzJk47rk,32682
|
|
8
|
+
mwx/matplot2g.py,sha256=Txcz3yusiFF0j1QnAS0dCGTbGrkx4VC6BZbWbjIRZnw,65585
|
|
9
|
+
mwx/matplot2lg.py,sha256=nKXxy1XZRLTo0WijeIGd0WtQrlSpI1cxkGRwCktrJjY,27263
|
|
10
|
+
mwx/mgplt.py,sha256=ITzxA97yDwr_35BUk5OqnyskSuKVDbpf2AQCKY1jHTI,5671
|
|
11
|
+
mwx/nutshell.py,sha256=5HErOObnOprMc6gYnXV7wY-ALnlwNpmhV8f0EyipYA4,135816
|
|
12
|
+
mwx/utilus.py,sha256=THDxQ-QqbHYVc8iX8qN9yxvfcf7Pvpm7sfTP9ipYvzs,37040
|
|
13
|
+
mwx/wxmon.py,sha256=Qk86VbuuW2rR46pqEYLur13G_aloWz5SVv6sib30YY0,12717
|
|
14
|
+
mwx/wxpdb.py,sha256=2z3ZD9Oo1H-ONBHlaprkB9hrTmAI7o03sqO46ppEFE4,19129
|
|
15
|
+
mwx/wxwil.py,sha256=JK1du4i1RVMbDLqN8jLRDSu_JhKEp4mhHVMElzo4yoE,5578
|
|
16
|
+
mwx/wxwit.py,sha256=2gFHi-8nwWRh26RdvZ_AUP--8PDjJB8TUU72y2fBUWM,7557
|
|
17
|
+
mwx/py/__init__.py,sha256=NzBazvjN9KMFoylsHsLiNOHbcDrNflgSwEFlkT12Rnw,39
|
|
18
|
+
mwx/py/ffmpeg_view.py,sha256=vUYNybIJsF1JGkDzjBgDyBQvDh8e1oKHlEMY5Fwc8L4,9399
|
|
19
|
+
mwx/py/fft_view.py,sha256=1bc6e6muXoo2EHV-w1w4glB7ecPjc6aQXlbX-UplC6I,2642
|
|
20
|
+
mwx/py/filling.py,sha256=KaHooM32hrGGgqw75Cbt8lAvACwC6RXadob9LGgNnEc,16806
|
|
21
|
+
mwx/py/frame_listview.py,sha256=T-2xSv_D2bk9fJ64aiSEe1rJRTeqaIpLVAYEUXW5vz8,10110
|
|
22
|
+
mwx/py/line_profile.py,sha256=WJB5z7F53yg4dII2R36IFZvtkSOGWT669b1HmAAXSnQ,816
|
|
23
|
+
mwxlib-0.93.7.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
|
|
24
|
+
mwxlib-0.93.7.dist-info/METADATA,sha256=7uW6eS4CsshRUk0W1Qf7o4qqcpVZNJjbA-KKyWW-zQc,1925
|
|
25
|
+
mwxlib-0.93.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
26
|
+
mwxlib-0.93.7.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
|
|
27
|
+
mwxlib-0.93.7.dist-info/RECORD,,
|
mwxlib-0.93.1.dist-info/RECORD
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
mwx/__init__.py,sha256=5B4YSOuijG1Uo5-FLtLHGB52Cp_F4vnN--4wGPBx7do,2398
|
|
2
|
-
mwx/bookshelf.py,sha256=FrissUYdGXLABOzJmMaQU6GXvu6n_9DVW3d5wGwQzjM,6613
|
|
3
|
-
mwx/controls.py,sha256=YpNuJZMrnCZKboXuo3DqYrjDsz2D1Filo0_eYGbAMPE,47177
|
|
4
|
-
mwx/framework.py,sha256=0gCoTxv1oEkLvBaZJShWkWgr6_bgFi6uRJ6iiGKNaEM,73976
|
|
5
|
-
mwx/graphman.py,sha256=fOmj062UEE5f9ej-P-lkS0oKV0lJv3w1BC_iZA7NW5Q,69656
|
|
6
|
-
mwx/images.py,sha256=mrnUYH12I3XLVSZcEXlpVltX0XMxufbl2yRvDIQJZqc,49957
|
|
7
|
-
mwx/matplot2.py,sha256=TM8V5Ggc5iL9lYyM6V4clqH_vIsgS0GsND2ay9zuT0c,32825
|
|
8
|
-
mwx/matplot2g.py,sha256=owNKt2EcSkf15hYqx9lnpF9qT-WqdSkXSRsH82sYMTs,65571
|
|
9
|
-
mwx/matplot2lg.py,sha256=IHURrul9JzcLO8Lyll1bW1G215pxgvutDmbQgayG70A,26341
|
|
10
|
-
mwx/mgplt.py,sha256=ITzxA97yDwr_35BUk5OqnyskSuKVDbpf2AQCKY1jHTI,5671
|
|
11
|
-
mwx/nutshell.py,sha256=PR4F30CVUKOT0w5JrzH9zLe1UE3-1a1NOuwBaO-_zks,135881
|
|
12
|
-
mwx/utilus.py,sha256=fqxJysHXdLt9OOSKDZnBOwmbHvHJPy1qH3R6dI3NLSw,36947
|
|
13
|
-
mwx/wxmon.py,sha256=Qk86VbuuW2rR46pqEYLur13G_aloWz5SVv6sib30YY0,12717
|
|
14
|
-
mwx/wxpdb.py,sha256=0nB_gDJrpJywtKV6DOXtXWnBttBxaEL5R6d9y0_3Pi8,19145
|
|
15
|
-
mwx/wxwil.py,sha256=KdNaHV-5-fYSFN4h3VxXxdgpB6s5PCpuxkSbytg85eE,5586
|
|
16
|
-
mwx/wxwit.py,sha256=2gFHi-8nwWRh26RdvZ_AUP--8PDjJB8TUU72y2fBUWM,7557
|
|
17
|
-
mwx/py/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
mwx/py/filling.py,sha256=KaHooM32hrGGgqw75Cbt8lAvACwC6RXadob9LGgNnEc,16806
|
|
19
|
-
mwxlib-0.93.1.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
|
|
20
|
-
mwxlib-0.93.1.dist-info/METADATA,sha256=a1lObWKZU5-EjzOzTNxAiOxvAW2JT2O7gBOyydT9oMA,1925
|
|
21
|
-
mwxlib-0.93.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
22
|
-
mwxlib-0.93.1.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
|
|
23
|
-
mwxlib-0.93.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|