mwxlib 0.81.0__py3-none-any.whl → 0.81.2__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/__init__.py +16 -20
- mwx/controls.py +9 -7
- mwx/framework.py +22 -24
- mwx/graphman.py +18 -3
- mwx/nutshell.py +8 -5
- mwx/wxwit.py +2 -1
- {mwxlib-0.81.0.dist-info → mwxlib-0.81.2.dist-info}/METADATA +1 -1
- {mwxlib-0.81.0.dist-info → mwxlib-0.81.2.dist-info}/RECORD +11 -11
- {mwxlib-0.81.0.dist-info → mwxlib-0.81.2.dist-info}/LICENSE +0 -0
- {mwxlib-0.81.0.dist-info → mwxlib-0.81.2.dist-info}/WHEEL +0 -0
- {mwxlib-0.81.0.dist-info → mwxlib-0.81.2.dist-info}/top_level.txt +0 -0
mwx/__init__.py
CHANGED
|
@@ -26,18 +26,6 @@ from .framework import Frame, MiniFrame, ShellFrame
|
|
|
26
26
|
## from .mgplt import Gnuplot
|
|
27
27
|
## from .mgplt import GnuplotFrame
|
|
28
28
|
|
|
29
|
-
from importlib import reload
|
|
30
|
-
import contextlib
|
|
31
|
-
import wx
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
@contextlib.contextmanager
|
|
35
|
-
def app(loop=True):
|
|
36
|
-
app = wx.GetApp() or wx.App()
|
|
37
|
-
yield app
|
|
38
|
-
if loop and not app.GetMainLoop():
|
|
39
|
-
app.MainLoop()
|
|
40
|
-
|
|
41
29
|
|
|
42
30
|
def deb(target=None, loop=True, locals=None, **kwargs):
|
|
43
31
|
"""Dive into the process.
|
|
@@ -60,6 +48,8 @@ def deb(target=None, loop=True, locals=None, **kwargs):
|
|
|
60
48
|
Note:
|
|
61
49
|
This will execute the startup script $(PYTHONSTARTUP).
|
|
62
50
|
"""
|
|
51
|
+
import wx
|
|
52
|
+
|
|
63
53
|
quote_unqoute = """
|
|
64
54
|
Anything one man can imagine, other man can make real.
|
|
65
55
|
--- Jules Verne (1828--1905)
|
|
@@ -68,11 +58,17 @@ def deb(target=None, loop=True, locals=None, **kwargs):
|
|
|
68
58
|
"mwx {}".format(__version__) + quote_unqoute)
|
|
69
59
|
kwargs.setdefault("execStartupScript", True)
|
|
70
60
|
kwargs.setdefault("ensureClose", True)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
61
|
+
|
|
62
|
+
app = wx.GetApp() or wx.App()
|
|
63
|
+
frame = ShellFrame(None, target, **kwargs)
|
|
64
|
+
frame.Show()
|
|
65
|
+
shell = frame.rootshell
|
|
66
|
+
shell.SetFocus()
|
|
67
|
+
if locals:
|
|
68
|
+
shell.locals.update(locals)
|
|
69
|
+
if loop:
|
|
70
|
+
if not app.GetMainLoop():
|
|
71
|
+
app.MainLoop()
|
|
72
|
+
else:
|
|
73
|
+
pass # The mainloop is already running.
|
|
74
|
+
return frame
|
mwx/controls.py
CHANGED
|
@@ -1133,11 +1133,12 @@ class Indicator(wx.Control):
|
|
|
1133
1133
|
spacing = 7
|
|
1134
1134
|
radius = 5
|
|
1135
1135
|
|
|
1136
|
-
def __init__(self, parent, value=0, tip='',
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1136
|
+
def __init__(self, parent, value=0, tip='',
|
|
1137
|
+
size=(-1,-1), style=wx.BORDER_NONE, **kwargs):
|
|
1138
|
+
s = self.spacing # minimum size:(6s,2s)
|
|
1139
|
+
w = max(size[0], s*6)
|
|
1140
|
+
h = max(size[1], s*2+1)
|
|
1141
|
+
wx.Control.__init__(self, parent, size=(w,h), style=style, **kwargs)
|
|
1141
1142
|
|
|
1142
1143
|
self.__value = value
|
|
1143
1144
|
self.ToolTip = tip.strip()
|
|
@@ -1201,8 +1202,9 @@ class Gauge(wx.Control):
|
|
|
1201
1202
|
self.__range = int(v)
|
|
1202
1203
|
self.Draw()
|
|
1203
1204
|
|
|
1204
|
-
def __init__(self, parent, range=24, value=0, tip='',
|
|
1205
|
-
|
|
1205
|
+
def __init__(self, parent, range=24, value=0, tip='',
|
|
1206
|
+
style=wx.BORDER_NONE, **kwargs):
|
|
1207
|
+
wx.Control.__init__(self, parent, style=style, **kwargs)
|
|
1206
1208
|
|
|
1207
1209
|
self.__range = range
|
|
1208
1210
|
self.__value = value
|
mwx/framework.py
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Author: Kazuya O'moto <komoto@jeol.co.jp>
|
|
6
6
|
"""
|
|
7
|
-
__version__ = "0.81.
|
|
7
|
+
__version__ = "0.81.2"
|
|
8
8
|
__author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
|
|
9
9
|
|
|
10
10
|
from functools import wraps, partial
|
|
@@ -388,9 +388,8 @@ def pack(self, items, orient=wx.HORIZONTAL, style=None, label=None):
|
|
|
388
388
|
Args:
|
|
389
389
|
items : wx objects (with some packing parameters)
|
|
390
390
|
|
|
391
|
-
- (obj, 1) -> sized with ratio 1 (orient
|
|
392
|
-
|
|
393
|
-
- (obj, 1, wx.EXPAND) -> expanded with ratio 1 (orient と垂直方向)
|
|
391
|
+
- (obj, 1) -> sized with ratio 1 (parallel to `orient`)
|
|
392
|
+
- (obj, 1, wx.EXPAND) -> expanded with ratio 1 (perpendicular to `orient`)
|
|
394
393
|
- (obj, 0, wx.ALIGN_CENTER | wx.LEFT, 4) -> center with 4 pixel at wx.LEFT
|
|
395
394
|
- ((-1,-1), 1, wx.EXPAND) -> stretched space
|
|
396
395
|
- (-1,-1) -> padding space
|
|
@@ -466,9 +465,9 @@ class Menu(wx.Menu):
|
|
|
466
465
|
menu_item.SetBitmaps(*icons)
|
|
467
466
|
self.Append(menu_item)
|
|
468
467
|
try:
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
468
|
+
owner.Bind(wx.EVT_MENU, handlers[0], menu_item)
|
|
469
|
+
owner.Bind(wx.EVT_UPDATE_UI, handlers[1], menu_item)
|
|
470
|
+
owner.Bind(wx.EVT_MENU_HIGHLIGHT, handlers[2], menu_item)
|
|
472
471
|
except IndexError:
|
|
473
472
|
pass
|
|
474
473
|
else:
|
|
@@ -479,8 +478,8 @@ class Menu(wx.Menu):
|
|
|
479
478
|
if icons:
|
|
480
479
|
submenu_item.SetBitmaps(*icons)
|
|
481
480
|
self.Append(submenu_item)
|
|
482
|
-
self.Enable(submenu_item.Id, len(subitems)) # Disable an empty menu
|
|
483
|
-
submenu.Id = submenu_item.Id # <- ID_ANY
|
|
481
|
+
self.Enable(submenu_item.Id, len(subitems)) # Disable an empty menu.
|
|
482
|
+
submenu.Id = submenu_item.Id # <- ID_ANY (dummy to check empty sbumenu)
|
|
484
483
|
|
|
485
484
|
@staticmethod
|
|
486
485
|
def Popup(parent, menu, *args, **kwargs):
|
|
@@ -521,14 +520,14 @@ class MenuBar(wx.MenuBar, TreeList):
|
|
|
521
520
|
"""
|
|
522
521
|
if self.Parent:
|
|
523
522
|
menu = self.getmenu(key)
|
|
524
|
-
if not menu:
|
|
525
|
-
self.reset()
|
|
523
|
+
if not menu:
|
|
524
|
+
self.reset()
|
|
526
525
|
return
|
|
527
526
|
|
|
528
527
|
for item in menu.MenuItems: # delete all items
|
|
529
|
-
self.Parent.Unbind(wx.EVT_MENU,
|
|
530
|
-
self.Parent.Unbind(wx.EVT_UPDATE_UI,
|
|
531
|
-
self.Parent.Unbind(wx.EVT_MENU_HIGHLIGHT,
|
|
528
|
+
self.Parent.Unbind(wx.EVT_MENU, item)
|
|
529
|
+
self.Parent.Unbind(wx.EVT_UPDATE_UI, item)
|
|
530
|
+
self.Parent.Unbind(wx.EVT_MENU_HIGHLIGHT, item)
|
|
532
531
|
menu.Delete(item)
|
|
533
532
|
|
|
534
533
|
menu2 = Menu(self.Parent, self[key]) # new menu2 to swap menu
|
|
@@ -536,7 +535,7 @@ class MenuBar(wx.MenuBar, TreeList):
|
|
|
536
535
|
menu.Append(menu2.Remove(item)) # 重複しないようにいったん切り離して追加する
|
|
537
536
|
|
|
538
537
|
if hasattr(menu, 'Id'):
|
|
539
|
-
self.Enable(menu.Id, menu.MenuItemCount > 0) #
|
|
538
|
+
self.Enable(menu.Id, menu.MenuItemCount > 0) # Disable empty submenu.
|
|
540
539
|
|
|
541
540
|
def reset(self):
|
|
542
541
|
"""Recreates menubar if the Parent were attached by SetMenuBar.
|
|
@@ -546,16 +545,16 @@ class MenuBar(wx.MenuBar, TreeList):
|
|
|
546
545
|
for j in range(self.GetMenuCount()): # remove and del all top-level menu
|
|
547
546
|
menu = self.Remove(0)
|
|
548
547
|
for item in menu.MenuItems: # delete all items
|
|
549
|
-
self.Parent.Unbind(wx.EVT_MENU,
|
|
550
|
-
self.Parent.Unbind(wx.EVT_UPDATE_UI,
|
|
551
|
-
self.Parent.Unbind(wx.EVT_MENU_HIGHLIGHT,
|
|
548
|
+
self.Parent.Unbind(wx.EVT_MENU, item)
|
|
549
|
+
self.Parent.Unbind(wx.EVT_UPDATE_UI, item)
|
|
550
|
+
self.Parent.Unbind(wx.EVT_MENU_HIGHLIGHT, item)
|
|
552
551
|
menu.Destroy()
|
|
553
552
|
|
|
554
553
|
for j, (key, values) in enumerate(self):
|
|
555
|
-
menu = Menu(self.Parent, values)
|
|
554
|
+
menu = Menu(self.Parent, values)
|
|
556
555
|
self.Append(menu, key)
|
|
557
556
|
if not values:
|
|
558
|
-
self.EnableTop(j, False) #
|
|
557
|
+
self.EnableTop(j, False) # Disable empty main menu.
|
|
559
558
|
|
|
560
559
|
|
|
561
560
|
class StatusBar(wx.StatusBar):
|
|
@@ -1213,8 +1212,7 @@ class ShellFrame(MiniFrame):
|
|
|
1213
1212
|
self.Log.default_buffer.SaveFile(self.LOGGING_FILE)
|
|
1214
1213
|
self.History.default_buffer.SaveFile(self.HISTORY_FILE)
|
|
1215
1214
|
self.save_session()
|
|
1216
|
-
|
|
1217
|
-
traceback.print_exc()
|
|
1215
|
+
self.timer.Stop()
|
|
1218
1216
|
finally:
|
|
1219
1217
|
self._mgr.UnInit()
|
|
1220
1218
|
return MiniFrame.Destroy(self)
|
|
@@ -1451,8 +1449,8 @@ class ShellFrame(MiniFrame):
|
|
|
1451
1449
|
def help(self, obj):
|
|
1452
1450
|
self.rootshell.help(obj)
|
|
1453
1451
|
|
|
1454
|
-
def highlight(self, obj):
|
|
1455
|
-
self.inspector.highlight(obj)
|
|
1452
|
+
def highlight(self, obj, *args, **kwargs):
|
|
1453
|
+
self.inspector.highlight(obj, *args, **kwargs)
|
|
1456
1454
|
|
|
1457
1455
|
## Note: history 変数に余計な文字列が入らないようにする
|
|
1458
1456
|
@postcall
|
mwx/graphman.py
CHANGED
|
@@ -408,12 +408,17 @@ class LayerInterface(CtrlInterface):
|
|
|
408
408
|
del self.Arts
|
|
409
409
|
|
|
410
410
|
|
|
411
|
-
class Layer(
|
|
411
|
+
class Layer(ControlPanel, LayerInterface):
|
|
412
412
|
"""Graphman.Layer
|
|
413
413
|
"""
|
|
414
414
|
def __init__(self, parent, session=None, **kwargs):
|
|
415
415
|
ControlPanel.__init__(self, parent, **kwargs)
|
|
416
416
|
LayerInterface.__init__(self, parent, session)
|
|
417
|
+
|
|
418
|
+
## Explicit (override) precedence
|
|
419
|
+
message = LayerInterface.message
|
|
420
|
+
IsShown = LayerInterface.IsShown
|
|
421
|
+
Show = LayerInterface.Show
|
|
417
422
|
|
|
418
423
|
|
|
419
424
|
class Graph(GraphPlot):
|
|
@@ -992,16 +997,24 @@ class Frame(mwx.Frame):
|
|
|
992
997
|
module = inspect.getmodule(cls) # rebase module or __main__
|
|
993
998
|
|
|
994
999
|
if issubclass(cls, LayerInterface):
|
|
995
|
-
warnings.warn("
|
|
1000
|
+
warnings.warn("Duplicate iniheritance of LayerInterface by {!r}."
|
|
996
1001
|
.format(cls.__name__), stacklevel=2)
|
|
997
1002
|
cls.__module__ = module.__name__ # __main__ to module
|
|
998
1003
|
module.Plugin = cls
|
|
999
1004
|
return cls
|
|
1000
1005
|
|
|
1001
|
-
class _Plugin(
|
|
1006
|
+
class _Plugin(cls, LayerInterface):
|
|
1002
1007
|
def __init__(self, parent, session=None, **kwargs):
|
|
1003
1008
|
cls.__init__(self, parent, **kwargs)
|
|
1004
1009
|
LayerInterface.__init__(self, parent, session)
|
|
1010
|
+
|
|
1011
|
+
## Explicit (override) precedence
|
|
1012
|
+
message = LayerInterface.message
|
|
1013
|
+
IsShown = LayerInterface.IsShown
|
|
1014
|
+
Show = LayerInterface.Show
|
|
1015
|
+
|
|
1016
|
+
## Implicit (override) precedence
|
|
1017
|
+
## cls.Init / cls.save_session / cls.load_session
|
|
1005
1018
|
|
|
1006
1019
|
_Plugin.__module__ = cls.__module__ = module.__name__
|
|
1007
1020
|
_Plugin.__name__ = cls.__name__ + str("~")
|
|
@@ -1023,6 +1036,8 @@ class Frame(mwx.Frame):
|
|
|
1023
1036
|
else:
|
|
1024
1037
|
rootpath = root
|
|
1025
1038
|
|
|
1039
|
+
assert isinstance(rootpath, str)
|
|
1040
|
+
|
|
1026
1041
|
name = os.path.basename(rootpath)
|
|
1027
1042
|
if name.endswith(".py"):
|
|
1028
1043
|
name,_ = os.path.splitext(name)
|
mwx/nutshell.py
CHANGED
|
@@ -115,10 +115,10 @@ class EditorInterface(CtrlInterface):
|
|
|
115
115
|
'C-S-; pressed' : (0, _F(self.comment_out_line)),
|
|
116
116
|
'C-: pressed' : (0, _F(self.uncomment_line)),
|
|
117
117
|
'C-S-: pressed' : (0, _F(self.uncomment_line)),
|
|
118
|
-
'Lbutton pressed' : (0, lambda v:
|
|
119
|
-
'Rbutton pressed' : (0, lambda v:
|
|
120
|
-
'Mbutton pressed' : (0, lambda v:
|
|
121
|
-
'Lbutton dblclick' : (0, lambda v:
|
|
118
|
+
'Lbutton pressed' : (0, lambda v: click_fork(v, 'Lclick')),
|
|
119
|
+
'Rbutton pressed' : (0, lambda v: click_fork(v, 'Rclick')),
|
|
120
|
+
'Mbutton pressed' : (0, lambda v: click_fork(v, 'Mclick')),
|
|
121
|
+
'Lbutton dblclick' : (0, lambda v: click_fork(v, 'dblclick')),
|
|
122
122
|
'margin_dblclick' : (0, self.on_margin_dblclick),
|
|
123
123
|
'select_itext' : (10, self.filter_text, self.on_filter_text_enter),
|
|
124
124
|
'select_line' : (100, self.on_linesel_begin, skip),
|
|
@@ -137,10 +137,12 @@ class EditorInterface(CtrlInterface):
|
|
|
137
137
|
},
|
|
138
138
|
})
|
|
139
139
|
|
|
140
|
-
def
|
|
140
|
+
def click_fork(v, click):
|
|
141
141
|
if self._margin is not None:
|
|
142
142
|
v.Margin = self._margin # Add info to event object. OK ??
|
|
143
143
|
self.handler(f"margin_{click}", v)
|
|
144
|
+
v.Skip()
|
|
145
|
+
self._margin = None
|
|
144
146
|
|
|
145
147
|
def on_motion(v):
|
|
146
148
|
self._window_handler('motion', v)
|
|
@@ -152,6 +154,7 @@ class EditorInterface(CtrlInterface):
|
|
|
152
154
|
self._margin = m # current margin under mouse
|
|
153
155
|
return
|
|
154
156
|
self._margin = None
|
|
157
|
+
v.Skip()
|
|
155
158
|
self.Bind(wx.EVT_MOTION, on_motion)
|
|
156
159
|
|
|
157
160
|
self.Bind(wx.EVT_MOUSE_CAPTURE_LOST,
|
mwx/wxwit.py
CHANGED
|
@@ -102,7 +102,8 @@ class Inspector(it.InspectionTree, CtrlInterface):
|
|
|
102
102
|
return "{} ({!r} {})".format(clsname, obj.Name, obj.Id)
|
|
103
103
|
return clsname
|
|
104
104
|
|
|
105
|
-
def highlight(self, obj):
|
|
105
|
+
def highlight(self, obj, msec=2000):
|
|
106
|
+
self.highlighter.highlightTime = msec
|
|
106
107
|
if isinstance(obj, wx.Window):
|
|
107
108
|
self.highlighter.HighlightWindow(obj)
|
|
108
109
|
elif isinstance(obj, wx.Sizer):
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
mwx/__init__.py,sha256=
|
|
2
|
-
mwx/controls.py,sha256=
|
|
3
|
-
mwx/framework.py,sha256=
|
|
4
|
-
mwx/graphman.py,sha256=
|
|
1
|
+
mwx/__init__.py,sha256=132PKNl-qpvV8godY4iAnHcupnmPTWfFx-j7tantnmA,2521
|
|
2
|
+
mwx/controls.py,sha256=nK98yYgWczs1xKUbCXyM7A2XXl84iOm65c8DRjMrTPI,43034
|
|
3
|
+
mwx/framework.py,sha256=rq5mUn4FYYwPhLT405HODh25rpgfhwytan0MnfIo_dk,71410
|
|
4
|
+
mwx/graphman.py,sha256=zXGOxVVWQJxlMl2TNigfCBIhiPAjlgMb8Qn-D1AxN88,69722
|
|
5
5
|
mwx/images.py,sha256=9e8X7OpJ6Z3fF3ez17P_qk2D1NMO10-lN8TCtulAqT0,46248
|
|
6
6
|
mwx/matplot2.py,sha256=mzctMUk00m-tvs268PTwdLln7G3NCl6J-5zFzJkfsVI,36004
|
|
7
7
|
mwx/matplot2g.py,sha256=yfF4r6juclU1I1k41lGb_VwxRmp0ktuD8az-wQ26MsE,67727
|
|
8
8
|
mwx/matplot2lg.py,sha256=h_aFij_7ksG2DXuYCaGmjtlcl122vZnwbMTv21Mprcg,27606
|
|
9
9
|
mwx/mgplt.py,sha256=49_wpFZUEKErQmtobqrlNKDjWlAsdLft-izlqSyGPD0,6878
|
|
10
|
-
mwx/nutshell.py,sha256=
|
|
10
|
+
mwx/nutshell.py,sha256=5BxB3TeyY1I5W0uDCSTZc6lh5nGW6ckBOQwHZa_RKD8,135235
|
|
11
11
|
mwx/utilus.py,sha256=NBU4PG3AQ8bE1Iadpe4QaZOGZYPh7NQ85ff6jxeKVG4,36281
|
|
12
12
|
mwx/wxmon.py,sha256=g55Ds_dRpDS8dNmaVQwgnd1inuj45tqLMIgJA23cOIw,11291
|
|
13
13
|
mwx/wxpdb.py,sha256=-_rDNxk3S3z1PgDZ6AAhKksFp8wJL3NBKDxfOZ74E3c,19790
|
|
14
14
|
mwx/wxwil.py,sha256=BUfEF0Nc1E-mVC3Vdz6k1E-2s5J0PO6qEzRQ6lfyePI,5246
|
|
15
|
-
mwx/wxwit.py,sha256=
|
|
15
|
+
mwx/wxwit.py,sha256=lJX2A26IcSA_MpdTnlV5QYg1PruE47ckk1yL8E_dYiE,7224
|
|
16
16
|
mwx/py/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
mwx/py/filling.py,sha256=NnQnfUVol-Nz4QYZUKFIyRX-Yxp54m5n54Yxza3Iwho,16655
|
|
18
|
-
mwxlib-0.81.
|
|
19
|
-
mwxlib-0.81.
|
|
20
|
-
mwxlib-0.81.
|
|
21
|
-
mwxlib-0.81.
|
|
22
|
-
mwxlib-0.81.
|
|
18
|
+
mwxlib-0.81.2.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
|
|
19
|
+
mwxlib-0.81.2.dist-info/METADATA,sha256=_7B7dFMBRvG7kIXyhuUBz8Ntv1Ul0tDDK1Qlv3hYc5Y,1893
|
|
20
|
+
mwxlib-0.81.2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
21
|
+
mwxlib-0.81.2.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
|
|
22
|
+
mwxlib-0.81.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|