mwxlib 1.0.8__py3-none-any.whl → 1.1.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.
Potentially problematic release.
This version of mwxlib might be problematic. Click here for more details.
- mwx/framework.py +8 -3
- mwx/nutshell.py +3 -4
- mwx/testsuite.py +58 -0
- mwx/utilus.py +2 -5
- {mwxlib-1.0.8.dist-info → mwxlib-1.1.0.dist-info}/METADATA +1 -1
- {mwxlib-1.0.8.dist-info → mwxlib-1.1.0.dist-info}/RECORD +9 -8
- {mwxlib-1.0.8.dist-info → mwxlib-1.1.0.dist-info}/LICENSE +0 -0
- {mwxlib-1.0.8.dist-info → mwxlib-1.1.0.dist-info}/WHEEL +0 -0
- {mwxlib-1.0.8.dist-info → mwxlib-1.1.0.dist-info}/top_level.txt +0 -0
mwx/framework.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#! python3
|
|
2
2
|
"""mwxlib framework.
|
|
3
3
|
"""
|
|
4
|
-
__version__ = "1.0
|
|
4
|
+
__version__ = "1.1.0"
|
|
5
5
|
__author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
|
|
6
6
|
|
|
7
7
|
from contextlib import contextmanager
|
|
@@ -261,8 +261,11 @@ class KeyCtrlInterfaceMixin:
|
|
|
261
261
|
},
|
|
262
262
|
})
|
|
263
263
|
|
|
264
|
+
builtins.enter = "Enter extension mode."
|
|
265
|
+
builtins.exit = "Exit extension mode."
|
|
266
|
+
|
|
264
267
|
def pre_command_hook(self, evt):
|
|
265
|
-
"""Called when entering extension mode (internal use only)."""
|
|
268
|
+
## """Called when entering extension mode (internal use only)."""
|
|
266
269
|
## Check text selection for [C-c/C-x].
|
|
267
270
|
wnd = wx.Window.FindFocus()
|
|
268
271
|
if isinstance(wnd, wx.TextEntry) and wnd.StringSelection\
|
|
@@ -271,9 +274,10 @@ class KeyCtrlInterfaceMixin:
|
|
|
271
274
|
else:
|
|
272
275
|
self.message(evt.key + '-')
|
|
273
276
|
evt.Skip()
|
|
277
|
+
pre_command_hook.__name__ = str('enter')
|
|
274
278
|
|
|
275
279
|
def post_command_hook(self, evt):
|
|
276
|
-
"""Called when exiting extension mode (internal use only)."""
|
|
280
|
+
## """Called when exiting extension mode (internal use only)."""
|
|
277
281
|
## Check if the event has reached a top-level window.
|
|
278
282
|
if isinstance(self, wx.TopLevelWindow):
|
|
279
283
|
return
|
|
@@ -283,6 +287,7 @@ class KeyCtrlInterfaceMixin:
|
|
|
283
287
|
else:
|
|
284
288
|
self.message(evt.key)
|
|
285
289
|
evt.Skip()
|
|
290
|
+
post_command_hook.__name__ = str('exit')
|
|
286
291
|
|
|
287
292
|
def define_key(self, keymap, action=None, *args, **kwargs):
|
|
288
293
|
"""Define [map key (pressed)] action.
|
mwx/nutshell.py
CHANGED
|
@@ -2637,10 +2637,9 @@ class Nautilus(EditorInterface, Shell):
|
|
|
2637
2637
|
|
|
2638
2638
|
- quoteback : x`y --> y=x | x`y`z --> z=y=x
|
|
2639
2639
|
- pullback : x@y --> y(x) | x@y@z --> z(y(x))
|
|
2640
|
-
- apropos : x.y? [not] p --> shows
|
|
2641
|
-
equiv. apropos(x, y [,ignorecase ?:True,??:False] [,pred=p])
|
|
2642
|
-
``y`` can contain regular expressions
|
|
2643
|
-
``y`` can contain abbreviations: \\a:[a-z], \\A:[A-Z] .
|
|
2640
|
+
- apropos : x.y? [not] p --> shows items (not) matched by predicate p
|
|
2641
|
+
equiv. apropos(x, y [,ignorecase ?:True,??:False] [,pred=p]).
|
|
2642
|
+
``y`` can contain regular expressions, but no dots or backslashes.
|
|
2644
2643
|
``p`` can be atom, callable, type (e.g., int, str, ...),
|
|
2645
2644
|
and any predicates such as inspect.isclass.
|
|
2646
2645
|
|
mwx/testsuite.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#! python3
|
|
2
|
+
"""Test suite for App, Frame, and ControlPanel.
|
|
3
|
+
|
|
4
|
+
Get the wx.App or wx.Frame instance and start the main-loop if needed.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
with testApp() as app:
|
|
8
|
+
frm = wx.Frame(None)
|
|
9
|
+
frm.Show()
|
|
10
|
+
|
|
11
|
+
Is equivlent to:
|
|
12
|
+
app = wx.App()
|
|
13
|
+
frm = wx.Frame(None)
|
|
14
|
+
frm.Show()
|
|
15
|
+
app.MainLoop()
|
|
16
|
+
"""
|
|
17
|
+
from contextlib import contextmanager
|
|
18
|
+
import wx
|
|
19
|
+
|
|
20
|
+
__all__ = ["testApp", "testFrame", "Plugman", "ControlPanel"]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@contextmanager
|
|
24
|
+
def testApp():
|
|
25
|
+
app = wx.GetApp() or wx.App()
|
|
26
|
+
yield app
|
|
27
|
+
if not app.GetMainLoop():
|
|
28
|
+
app.MainLoop()
|
|
29
|
+
## wx.App.run = staticmethod(testApp)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@contextmanager
|
|
33
|
+
def testFrame(**kwargs):
|
|
34
|
+
with testApp():
|
|
35
|
+
frm = wx.Frame(None, **kwargs)
|
|
36
|
+
yield frm
|
|
37
|
+
frm.Show()
|
|
38
|
+
## wx.Frame.run = staticmethod(testFrame)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@contextmanager
|
|
42
|
+
def Plugman(**kwargs):
|
|
43
|
+
import mwx.graphman
|
|
44
|
+
with testApp():
|
|
45
|
+
frm = mwx.graphman.Frame(None, **kwargs)
|
|
46
|
+
yield frm
|
|
47
|
+
frm.Show()
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@contextmanager
|
|
51
|
+
def ControlPanel(**kwargs):
|
|
52
|
+
import mwx
|
|
53
|
+
with testApp():
|
|
54
|
+
frm = mwx.Frame(None)
|
|
55
|
+
panel = mwx.ControlPanel(frm, **kwargs)
|
|
56
|
+
yield panel
|
|
57
|
+
panel.Sizer.Fit(frm)
|
|
58
|
+
frm.Show()
|
mwx/utilus.py
CHANGED
|
@@ -138,9 +138,6 @@ def apropos(obj, rexpr='', ignorecase=True, alias=None, pred=None, locals=None):
|
|
|
138
138
|
"""
|
|
139
139
|
name = alias or typename(obj)
|
|
140
140
|
|
|
141
|
-
rexpr = (rexpr.replace('\\a','[a-z0-9]') #\a: identifier chars (custom rule)
|
|
142
|
-
.replace('\\A','[A-Z0-9]')) #\A:
|
|
143
|
-
|
|
144
141
|
if isinstance(pred, str):
|
|
145
142
|
pred = predicate(pred, locals)
|
|
146
143
|
|
|
@@ -326,9 +323,9 @@ def split_tokens(text, comment=True):
|
|
|
326
323
|
j, k = 1, 0
|
|
327
324
|
for type, string, start, end, line in tokens:
|
|
328
325
|
l, m = start
|
|
329
|
-
if type in (
|
|
326
|
+
if type in (tokenize.ENDMARKER, tokenize.INDENT, tokenize.DEDENT):
|
|
330
327
|
continue
|
|
331
|
-
if type ==
|
|
328
|
+
if type == tokenize.COMMENT and not comment:
|
|
332
329
|
token = next(tokens) # eats a trailing token
|
|
333
330
|
string = token.string # cr/lf or ''
|
|
334
331
|
if m == 0:
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
mwx/__init__.py,sha256=psabnAMei5VzB2TsB2qBNLrIZMX0LiqjlXCpNGmDejk,668
|
|
2
2
|
mwx/bookshelf.py,sha256=so-xSLq08sMlJBErTxOaDoKUAMa_g1CkIP2pNnff68c,5607
|
|
3
3
|
mwx/controls.py,sha256=cNZkgwSv90lPIz61FvMtYxHIt8hJD_RQYXxsgTQIdLc,47949
|
|
4
|
-
mwx/framework.py,sha256=
|
|
4
|
+
mwx/framework.py,sha256=eDCdsCjn0-dgeGh4RjTmkoKCyQa96_YXSWF6zFped4Y,75759
|
|
5
5
|
mwx/graphman.py,sha256=04bEw7TEIs6X1QrgqBSLJoIhJnW5TwHTW_wZOvJYSwo,69840
|
|
6
6
|
mwx/images.py,sha256=oxCn0P-emiWujSS2gUgU5TUnr5cPjix2jBcjOBDr24I,48701
|
|
7
7
|
mwx/matplot2.py,sha256=RuVWXC2A_qgZRNmBBptbHDn5MyxaWBqp3ru4bP_lDE0,33150
|
|
8
8
|
mwx/matplot2g.py,sha256=4G5uZJZzATEC3QEVZ4pGHetEDfu5NJNUFyeAaQScK5s,64495
|
|
9
9
|
mwx/matplot2lg.py,sha256=JRWjWnLJUytbSq6wxs4P0gbVUr3xoLSF6Wwqd5V_pJI,27404
|
|
10
10
|
mwx/mgplt.py,sha256=M5rt-H7Uq1OHnlFvMA4a3945UBvppbR9L_mw8NL_YZ0,5602
|
|
11
|
-
mwx/nutshell.py,sha256
|
|
12
|
-
mwx/
|
|
11
|
+
mwx/nutshell.py,sha256=MLE667zDFB2iZSpW1m0AwLxRAh6HUYLMyl4OLV_VXAI,141532
|
|
12
|
+
mwx/testsuite.py,sha256=gPoqnBzG4wnON785Pn5lEuWFgenrY6KhPH-e1WZbKfA,1234
|
|
13
|
+
mwx/utilus.py,sha256=sZehJJHBQ7aGpzEMClmowqExVO7esyVMK7Tk-MJO6tQ,37293
|
|
13
14
|
mwx/wxmon.py,sha256=yzWqrbY6LzpfRwQeytYUeqFhFuLVm_XEvrVAL_k0HBQ,12756
|
|
14
15
|
mwx/wxpdb.py,sha256=--TQr-_zs9dWPYV2V4s3Zr4abvN14o5wD8anT9frHUg,18875
|
|
15
16
|
mwx/wxwil.py,sha256=hhyB1lPrF9ixeObxCOKQv0Theu-B-kpJg_yVU3EGSNg,5406
|
|
@@ -21,8 +22,8 @@ mwx/plugins/frame_listview.py,sha256=gowjQ-ARNonMkDSXkQgPKq4U9YBJ-vQ0jK2krBVOdCs
|
|
|
21
22
|
mwx/plugins/line_profile.py,sha256=zzm6_7lnAnNepLbh07ordp3nRWDFQJtu719ZVjrVf8s,819
|
|
22
23
|
mwx/py/__init__.py,sha256=xykgfOytOwNuvXsfkLoumFZSTN-iBsHOjczYXngjmUE,12
|
|
23
24
|
mwx/py/filling.py,sha256=fumUG1F5M9TL-Dfqni4G85uk7TmvnUunTbdcPDV0vfo,16857
|
|
24
|
-
mwxlib-1.0.
|
|
25
|
-
mwxlib-1.0.
|
|
26
|
-
mwxlib-1.0.
|
|
27
|
-
mwxlib-1.0.
|
|
28
|
-
mwxlib-1.0.
|
|
25
|
+
mwxlib-1.1.0.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
|
|
26
|
+
mwxlib-1.1.0.dist-info/METADATA,sha256=JHue3ApnAKemSra3UbiHgzXbe0pk7pkwoSMEF_jOTco,7259
|
|
27
|
+
mwxlib-1.1.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
28
|
+
mwxlib-1.1.0.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
|
|
29
|
+
mwxlib-1.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|