mwxlib 0.99.8__py3-none-any.whl → 1.0rc0__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 +2 -2
- mwx/controls.py +97 -119
- mwx/framework.py +43 -1
- mwx/matplot2.py +1 -1
- mwx/nutshell.py +15 -14
- mwx/utilus.py +2 -0
- {mwxlib-0.99.8.dist-info → mwxlib-1.0rc0.dist-info}/METADATA +8 -13
- {mwxlib-0.99.8.dist-info → mwxlib-1.0rc0.dist-info}/RECORD +11 -11
- {mwxlib-0.99.8.dist-info → mwxlib-1.0rc0.dist-info}/LICENSE +0 -0
- {mwxlib-0.99.8.dist-info → mwxlib-1.0rc0.dist-info}/WHEEL +0 -0
- {mwxlib-0.99.8.dist-info → mwxlib-1.0rc0.dist-info}/top_level.txt +0 -0
mwx/__init__.py
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
from .framework import __version__, __author__
|
|
5
5
|
from .framework import FSM, TreeList
|
|
6
6
|
from .framework import Menu, MenuBar, StatusBar
|
|
7
|
-
from .framework import Frame, MiniFrame, ShellFrame, deb
|
|
7
|
+
from .framework import Frame, MiniFrame, ShellFrame, deb, TestSuite
|
|
8
8
|
|
|
9
9
|
## Controls
|
|
10
10
|
from .controls import Param, LParam, Knob, ControlPanel, Clipboard, Icon
|
|
11
|
-
from .controls import Button, ToggleButton, TextCtrl, Choice, Gauge, Indicator
|
|
11
|
+
from .controls import Button, ToggleButton, ClassicButton, TextCtrl, Choice, Gauge, Indicator
|
|
12
12
|
|
|
13
13
|
## Plugman
|
|
14
14
|
## from .graphman import Frame as GraphmanFrame, Layer, Thread, Graph
|
mwx/controls.py
CHANGED
|
@@ -823,8 +823,17 @@ class Clipboard:
|
|
|
823
823
|
## --------------------------------
|
|
824
824
|
## Wx custom controls and bitmaps
|
|
825
825
|
## --------------------------------
|
|
826
|
-
|
|
827
|
-
|
|
826
|
+
|
|
827
|
+
class Icon(wx.Bitmap):
|
|
828
|
+
"""Returns an iconic bitmap with the specified size (w, h).
|
|
829
|
+
|
|
830
|
+
The key is either Icon.provided_arts or Icon.custom_images key.
|
|
831
|
+
If the key is empty it returns a transparent bitmap, otherwise NullBitmap.
|
|
832
|
+
|
|
833
|
+
Note:
|
|
834
|
+
A null (0-shaped) bitmap fails with AssertionError from 4.1.1
|
|
835
|
+
"""
|
|
836
|
+
provided_arts = {
|
|
828
837
|
'cut' : wx.ART_CUT,
|
|
829
838
|
'copy' : wx.ART_COPY,
|
|
830
839
|
'paste' : wx.ART_PASTE,
|
|
@@ -858,32 +867,69 @@ if 1:
|
|
|
858
867
|
'|<-' : wx.ART_GOTO_FIRST,
|
|
859
868
|
'->|' : wx.ART_GOTO_LAST,
|
|
860
869
|
}
|
|
861
|
-
|
|
870
|
+
custom_images = {
|
|
862
871
|
k:v for k, v in vars(images).items()
|
|
863
872
|
if isinstance(v, wx.lib.embeddedimage.PyEmbeddedImage)
|
|
864
873
|
}
|
|
865
|
-
|
|
866
|
-
class Icon(wx.Bitmap):
|
|
867
|
-
"""Returns an iconic bitmap with the specified size (w, h).
|
|
868
|
-
|
|
869
|
-
The key is either Icon.provided_arts or Icon.custom_images key.
|
|
870
|
-
If the key is empty it returns a transparent bitmap, otherwise NullBitmap.
|
|
871
|
-
|
|
872
|
-
Note:
|
|
873
|
-
A null (0-shaped) bitmap fails with AssertionError from 4.1.1
|
|
874
|
-
"""
|
|
875
|
-
provided_arts = _provided_arts
|
|
876
|
-
custom_images = _custom_images
|
|
877
874
|
|
|
878
875
|
def __init__(self, *args, **kwargs):
|
|
879
876
|
try:
|
|
880
|
-
bmp = _getBitmap1(*args, **kwargs)
|
|
877
|
+
bmp = Icon._getBitmap1(*args, **kwargs)
|
|
881
878
|
except TypeError:
|
|
882
|
-
bmp = _getBitmap2(*args, **kwargs)
|
|
879
|
+
bmp = Icon._getBitmap2(*args, **kwargs)
|
|
883
880
|
wx.Bitmap.__init__(self, bmp)
|
|
884
881
|
|
|
885
882
|
@staticmethod
|
|
886
|
-
def
|
|
883
|
+
def _getBitmap1(key, size=None):
|
|
884
|
+
if isinstance(key, wx.Bitmap):
|
|
885
|
+
if size and key.Size != size:
|
|
886
|
+
key = (key.ConvertToImage()
|
|
887
|
+
.Scale(*size, wx.IMAGE_QUALITY_NEAREST)
|
|
888
|
+
.ConvertToBitmap())
|
|
889
|
+
return key #<wx.Bitmap>
|
|
890
|
+
if not size:
|
|
891
|
+
size = (16, 16)
|
|
892
|
+
if key:
|
|
893
|
+
try:
|
|
894
|
+
art = Icon.custom_images.get(key)
|
|
895
|
+
bmp = art.GetBitmap()
|
|
896
|
+
except Exception:
|
|
897
|
+
art = Icon.provided_arts.get(key)
|
|
898
|
+
bmp = wx.ArtProvider.GetBitmap(art or key, wx.ART_OTHER, size)
|
|
899
|
+
return bmp
|
|
900
|
+
|
|
901
|
+
## Note: null (0-shaped) bitmap fails with AssertionError from 4.1.1
|
|
902
|
+
elif key == '':
|
|
903
|
+
bmp = wx.Bitmap(size)
|
|
904
|
+
with wx.MemoryDC(bmp) as dc:
|
|
905
|
+
dc.SetBackground(wx.Brush('black'))
|
|
906
|
+
dc.Clear()
|
|
907
|
+
bmp.SetMaskColour('black') # return dummy-sized blank bitmap
|
|
908
|
+
return bmp
|
|
909
|
+
|
|
910
|
+
return wx.NullBitmap # The standard wx controls accept this,
|
|
911
|
+
|
|
912
|
+
@staticmethod
|
|
913
|
+
def _getBitmap2(back, fore, size=None, subsize=3/4):
|
|
914
|
+
if not size:
|
|
915
|
+
size = (16, 16)
|
|
916
|
+
if isinstance(subsize, float):
|
|
917
|
+
subsize = wx.Size(size) * subsize
|
|
918
|
+
back = Icon._getBitmap1(back, size)
|
|
919
|
+
fore = Icon._getBitmap1(fore, subsize)
|
|
920
|
+
x = size[0] - subsize[0]
|
|
921
|
+
y = size[1] - subsize[1]
|
|
922
|
+
with wx.MemoryDC(back) as dc:
|
|
923
|
+
## dc = wx.GCDC(dc)
|
|
924
|
+
## dc.DrawBitmap(fore, x, y, useMask=True)
|
|
925
|
+
gc = wx.GraphicsContext.Create(dc)
|
|
926
|
+
gc.DrawBitmap(fore, x, y, *subsize)
|
|
927
|
+
return back
|
|
928
|
+
|
|
929
|
+
@staticmethod
|
|
930
|
+
def bullet(colour, ec=None, size=None, radius=4):
|
|
931
|
+
if not size:
|
|
932
|
+
size = (16, 16)
|
|
887
933
|
bmp = wx.Bitmap(size)
|
|
888
934
|
with wx.MemoryDC(bmp) as dc:
|
|
889
935
|
dc.SetBackground(wx.Brush('black'))
|
|
@@ -910,55 +956,24 @@ class Icon(wx.Bitmap):
|
|
|
910
956
|
return bmp
|
|
911
957
|
|
|
912
958
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
if key.Size != size:
|
|
916
|
-
key = (key.ConvertToImage()
|
|
917
|
-
.Scale(*size, wx.IMAGE_QUALITY_NEAREST)
|
|
918
|
-
.ConvertToBitmap())
|
|
919
|
-
return key
|
|
920
|
-
if key:
|
|
921
|
-
try:
|
|
922
|
-
art = _custom_images.get(key)
|
|
923
|
-
bmp = art.GetBitmap()
|
|
924
|
-
except Exception:
|
|
925
|
-
art = _provided_arts.get(key)
|
|
926
|
-
bmp = wx.ArtProvider.GetBitmap(art or key, wx.ART_OTHER, size)
|
|
927
|
-
return bmp
|
|
928
|
-
|
|
929
|
-
## Note: null (0-shaped) bitmap fails with AssertionError from 4.1.1
|
|
930
|
-
elif key == '':
|
|
931
|
-
bmp = wx.Bitmap(size)
|
|
932
|
-
with wx.MemoryDC(bmp) as dc:
|
|
933
|
-
dc.SetBackground(wx.Brush('black'))
|
|
934
|
-
dc.Clear()
|
|
935
|
-
bmp.SetMaskColour('black') # return dummy-sized blank bitmap
|
|
936
|
-
return bmp
|
|
959
|
+
class ClassicButton(wx.Button):
|
|
960
|
+
"""Flat button
|
|
937
961
|
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
return back
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
def _Icon(v):
|
|
957
|
-
if isinstance(v, (str, bytes)):
|
|
958
|
-
return Icon(v)
|
|
959
|
-
if isinstance(v, wx.lib.embeddedimage.PyEmbeddedImage):
|
|
960
|
-
return v.GetBitmap()
|
|
961
|
-
return v
|
|
962
|
+
Args:
|
|
963
|
+
label : button label
|
|
964
|
+
handler : event handler when the button is pressed
|
|
965
|
+
icon : key:str or bitmap for button icon
|
|
966
|
+
**kwargs: keywords for wx.lib.platebtn.PlateButton
|
|
967
|
+
"""
|
|
968
|
+
def __init__(self, parent, label='', handler=None, icon=None, **kwargs):
|
|
969
|
+
wx.Button.__init__(self, parent, -1, label, **kwargs)
|
|
970
|
+
|
|
971
|
+
if handler:
|
|
972
|
+
self.Bind(wx.EVT_BUTTON, _F(handler))
|
|
973
|
+
|
|
974
|
+
self.SetToolTip(_Tip(handler.__doc__))
|
|
975
|
+
if icon:
|
|
976
|
+
self.SetBitmap(Icon(icon))
|
|
962
977
|
|
|
963
978
|
|
|
964
979
|
class Button(pb.PlateButton):
|
|
@@ -970,17 +985,6 @@ class Button(pb.PlateButton):
|
|
|
970
985
|
icon : key:str or bitmap for button icon
|
|
971
986
|
**kwargs: keywords for wx.lib.platebtn.PlateButton
|
|
972
987
|
"""
|
|
973
|
-
@property
|
|
974
|
-
def icon(self):
|
|
975
|
-
"""Icon key:str or bitmap."""
|
|
976
|
-
return self.__icon
|
|
977
|
-
|
|
978
|
-
@icon.setter
|
|
979
|
-
def icon(self, v):
|
|
980
|
-
self.__icon = v
|
|
981
|
-
self.SetBitmap(_Icon(v))
|
|
982
|
-
self.Refresh()
|
|
983
|
-
|
|
984
988
|
def __init__(self, parent, label='', handler=None, icon=None, **kwargs):
|
|
985
989
|
kwargs.setdefault('style', pb.PB_STYLE_DEFAULT | pb.PB_STYLE_SQUARE)
|
|
986
990
|
pb.PlateButton.__init__(self, parent, -1, label, **kwargs)
|
|
@@ -988,8 +992,9 @@ class Button(pb.PlateButton):
|
|
|
988
992
|
if handler:
|
|
989
993
|
self.Bind(wx.EVT_BUTTON, _F(handler))
|
|
990
994
|
|
|
991
|
-
self.
|
|
992
|
-
|
|
995
|
+
self.SetToolTip(_Tip(handler.__doc__))
|
|
996
|
+
if icon:
|
|
997
|
+
self.SetBitmap(Icon(icon))
|
|
993
998
|
|
|
994
999
|
def SetBitmap(self, bmp):
|
|
995
1000
|
"""Set the bitmap displayed in the button.
|
|
@@ -998,7 +1003,8 @@ class Button(pb.PlateButton):
|
|
|
998
1003
|
try:
|
|
999
1004
|
pb.PlateButton.SetBitmap(self, bmp)
|
|
1000
1005
|
except Exception:
|
|
1001
|
-
self._bmp =
|
|
1006
|
+
self._bmp['enable'] = None
|
|
1007
|
+
self._bmp['disable'] = None
|
|
1002
1008
|
|
|
1003
1009
|
|
|
1004
1010
|
class ToggleButton(wx.ToggleButton):
|
|
@@ -1013,29 +1019,19 @@ class ToggleButton(wx.ToggleButton):
|
|
|
1013
1019
|
Note:
|
|
1014
1020
|
To get the status, check Value or event.GetInt or event.IsChecked.
|
|
1015
1021
|
"""
|
|
1016
|
-
@property
|
|
1017
|
-
def icon(self):
|
|
1018
|
-
"""Icon key:str or bitmap."""
|
|
1019
|
-
return self.__icon
|
|
1020
|
-
|
|
1021
|
-
@icon.setter
|
|
1022
|
-
def icon(self, v):
|
|
1023
|
-
self.__icon = v
|
|
1024
|
-
if isinstance(v, tuple):
|
|
1025
|
-
self.SetBitmap(_Icon(v[0]))
|
|
1026
|
-
self.SetBitmapPressed(_Icon(v[1]))
|
|
1027
|
-
elif v:
|
|
1028
|
-
self.SetBitmap(_Icon(v))
|
|
1029
|
-
self.Refresh()
|
|
1030
|
-
|
|
1031
1022
|
def __init__(self, parent, label='', handler=None, icon=None, **kwargs):
|
|
1032
1023
|
wx.ToggleButton.__init__(self, parent, -1, label, **kwargs)
|
|
1033
1024
|
|
|
1034
1025
|
if handler:
|
|
1035
1026
|
self.Bind(wx.EVT_TOGGLEBUTTON, _F(handler))
|
|
1036
1027
|
|
|
1037
|
-
self.
|
|
1038
|
-
|
|
1028
|
+
self.SetToolTip(_Tip(handler.__doc__))
|
|
1029
|
+
if icon:
|
|
1030
|
+
try:
|
|
1031
|
+
self.SetBitmap(Icon(icon[0]))
|
|
1032
|
+
self.SetBitmapPressed(Icon(icon[1]))
|
|
1033
|
+
except Exception:
|
|
1034
|
+
self.SetBitmap(Icon(icon))
|
|
1039
1035
|
|
|
1040
1036
|
|
|
1041
1037
|
class TextCtrl(wx.Control):
|
|
@@ -1057,15 +1053,6 @@ class TextCtrl(wx.Control):
|
|
|
1057
1053
|
|
|
1058
1054
|
value = Value #: internal use only
|
|
1059
1055
|
|
|
1060
|
-
@property
|
|
1061
|
-
def icon(self):
|
|
1062
|
-
"""Icon key:str or bitmap."""
|
|
1063
|
-
return self._btn.icon
|
|
1064
|
-
|
|
1065
|
-
@icon.setter
|
|
1066
|
-
def icon(self, v):
|
|
1067
|
-
self._btn.icon = v
|
|
1068
|
-
|
|
1069
1056
|
def __init__(self, parent, label='', handler=None, updater=None,
|
|
1070
1057
|
icon=None, readonly=False, size=(-1,-1), **kwargs):
|
|
1071
1058
|
wx.Control.__init__(self, parent, size=size, style=wx.BORDER_NONE)
|
|
@@ -1077,8 +1064,8 @@ class TextCtrl(wx.Control):
|
|
|
1077
1064
|
self._ctrl = wx.TextCtrl(self, **kwargs)
|
|
1078
1065
|
self._btn = Button(self, label, None, icon,
|
|
1079
1066
|
size=(-1,-1) if label or icon else (0,0))
|
|
1080
|
-
self._ctrl.
|
|
1081
|
-
self._btn.
|
|
1067
|
+
self._ctrl.SetToolTip(_Tip(handler.__doc__))
|
|
1068
|
+
self._btn.SetToolTip(_Tip(updater.__doc__))
|
|
1082
1069
|
|
|
1083
1070
|
self.SetSizer(
|
|
1084
1071
|
pack(self, (
|
|
@@ -1134,15 +1121,6 @@ class Choice(wx.Control):
|
|
|
1134
1121
|
lambda self,v: self._ctrl.SetItems(v),
|
|
1135
1122
|
doc="combobox items:list")
|
|
1136
1123
|
|
|
1137
|
-
@property
|
|
1138
|
-
def icon(self):
|
|
1139
|
-
"""Icon key:str or bitmap."""
|
|
1140
|
-
return self._btn.icon
|
|
1141
|
-
|
|
1142
|
-
@icon.setter
|
|
1143
|
-
def icon(self, v):
|
|
1144
|
-
self._btn.icon = v
|
|
1145
|
-
|
|
1146
1124
|
def __init__(self, parent, label='', handler=None, updater=None,
|
|
1147
1125
|
icon=None, readonly=False, size=(-1,-1), **kwargs):
|
|
1148
1126
|
wx.Control.__init__(self, parent, size=size, style=wx.BORDER_NONE)
|
|
@@ -1154,8 +1132,8 @@ class Choice(wx.Control):
|
|
|
1154
1132
|
self._ctrl = wx.ComboBox(self, **kwargs)
|
|
1155
1133
|
self._btn = Button(self, label, None, icon,
|
|
1156
1134
|
size=(-1,-1) if label or icon else (0,0))
|
|
1157
|
-
self._ctrl.
|
|
1158
|
-
self._btn.
|
|
1135
|
+
self._ctrl.SetToolTip(_Tip(handler.__doc__))
|
|
1136
|
+
self._btn.SetToolTip(_Tip(updater.__doc__))
|
|
1159
1137
|
|
|
1160
1138
|
self.SetSizer(
|
|
1161
1139
|
pack(self, (
|
mwx/framework.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#! python3
|
|
2
2
|
"""mwxlib framework.
|
|
3
3
|
"""
|
|
4
|
-
__version__ = "
|
|
4
|
+
__version__ = "1.0rc"
|
|
5
5
|
__author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
|
|
6
6
|
|
|
7
7
|
from contextlib import contextmanager
|
|
@@ -24,6 +24,48 @@ from .utilus import get_rootpath, ignore, warn
|
|
|
24
24
|
from .utilus import FSM, TreeList, apropos, typename, where, mro, pp
|
|
25
25
|
|
|
26
26
|
|
|
27
|
+
class TestSuite:
|
|
28
|
+
"""Test suite class for App, Frame, and Control Panel.
|
|
29
|
+
|
|
30
|
+
Get the wx.App instance and start the main-loop if needed.
|
|
31
|
+
|
|
32
|
+
Usage:
|
|
33
|
+
with TestSuite.App() as app:
|
|
34
|
+
frm = wx.Frame(None)
|
|
35
|
+
frm.Show()
|
|
36
|
+
|
|
37
|
+
Is equivlent to:
|
|
38
|
+
app = wx.App()
|
|
39
|
+
frm = wx.Frame(None)
|
|
40
|
+
frm.Show()
|
|
41
|
+
app.MainLoop()
|
|
42
|
+
"""
|
|
43
|
+
@staticmethod
|
|
44
|
+
@contextmanager
|
|
45
|
+
def App():
|
|
46
|
+
app = wx.GetApp() or wx.App()
|
|
47
|
+
yield app
|
|
48
|
+
if not app.GetMainLoop():
|
|
49
|
+
app.MainLoop()
|
|
50
|
+
|
|
51
|
+
@staticmethod
|
|
52
|
+
@contextmanager
|
|
53
|
+
def Frame(**kwargs):
|
|
54
|
+
with TestSuite.App():
|
|
55
|
+
frm = wx.Frame(None, **kwargs)
|
|
56
|
+
yield frm
|
|
57
|
+
frm.Show()
|
|
58
|
+
|
|
59
|
+
@staticmethod
|
|
60
|
+
@contextmanager
|
|
61
|
+
def Panel(**kwargs):
|
|
62
|
+
from .controls import ControlPanel
|
|
63
|
+
with TestSuite.Frame() as frm:
|
|
64
|
+
panel = ControlPanel(frm, **kwargs)
|
|
65
|
+
yield panel
|
|
66
|
+
panel.Sizer.Fit(frm)
|
|
67
|
+
|
|
68
|
+
|
|
27
69
|
def deb(target=None, loop=True, locals=None, debrc=None, **kwargs):
|
|
28
70
|
"""Dive into the process.
|
|
29
71
|
|
mwx/matplot2.py
CHANGED
|
@@ -387,7 +387,7 @@ class MatplotPanel(wx.Panel):
|
|
|
387
387
|
def on_modeline_tip(self, evt): #<wx._core.MouseEvent>
|
|
388
388
|
flag = self.modeline.HitTest(evt.Position)
|
|
389
389
|
if flag == wx.HT_WINDOW_INSIDE:
|
|
390
|
-
self.modeline.
|
|
390
|
+
self.modeline.SetToolTip(self.modeline.Label)
|
|
391
391
|
evt.Skip()
|
|
392
392
|
|
|
393
393
|
def on_focus_set(self, evt): #<wx._core.FocusEvent>
|
mwx/nutshell.py
CHANGED
|
@@ -635,8 +635,8 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
|
|
|
635
635
|
|
|
636
636
|
self.IndicatorSetStyle(11, stc.STC_INDIC_STRAIGHTBOX)
|
|
637
637
|
self.IndicatorSetUnder(11, True)
|
|
638
|
-
self.IndicatorSetAlpha(11,
|
|
639
|
-
self.IndicatorSetOutlineAlpha(11,
|
|
638
|
+
self.IndicatorSetAlpha(11, 50)
|
|
639
|
+
self.IndicatorSetOutlineAlpha(11, 50)
|
|
640
640
|
self.IndicatorSetForeground(11, "yellow")
|
|
641
641
|
|
|
642
642
|
self.IndicatorSetStyle(2, stc.STC_INDIC_DOTS)
|
|
@@ -804,11 +804,11 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
|
|
|
804
804
|
self.mark = self.cpos
|
|
805
805
|
|
|
806
806
|
def set_pointer(self):
|
|
807
|
-
if self.pointer == self.cline:
|
|
807
|
+
if self.pointer == self.cline: # toggle
|
|
808
808
|
self.pointer = -1
|
|
809
809
|
else:
|
|
810
|
-
self.pointer = self.cline
|
|
811
|
-
|
|
810
|
+
self.pointer = self.cline # reset
|
|
811
|
+
self.red_pointer = -1
|
|
812
812
|
|
|
813
813
|
def exchange_point_and_mark(self):
|
|
814
814
|
p = self.cpos
|
|
@@ -2144,7 +2144,6 @@ class Buffer(EditorInterface, EditWindow):
|
|
|
2144
2144
|
self.AnnotationSetStyle(lx, stc.STC_STYLE_ANNOTATION)
|
|
2145
2145
|
self.AnnotationSetText(lx, msg)
|
|
2146
2146
|
self.message(e)
|
|
2147
|
-
## print(msg, file=sys.__stderr__)
|
|
2148
2147
|
else:
|
|
2149
2148
|
self.code = code
|
|
2150
2149
|
del self.pointer # Reset pointer (debugger hook point).
|
|
@@ -2583,19 +2582,21 @@ class Interpreter(interpreter.Interpreter):
|
|
|
2583
2582
|
interpreter.Interpreter.showtraceback(self)
|
|
2584
2583
|
|
|
2585
2584
|
t, v, tb = sys.exc_info()
|
|
2586
|
-
|
|
2587
|
-
|
|
2585
|
+
while tb.tb_next:
|
|
2586
|
+
tb = tb.tb_next
|
|
2587
|
+
v.lineno = tb.tb_lineno
|
|
2588
|
+
v.filename = tb.tb_frame.f_code.co_filename
|
|
2588
2589
|
try:
|
|
2589
2590
|
self.parent.handler('interp_error', v)
|
|
2590
2591
|
except AttributeError:
|
|
2591
2592
|
pass
|
|
2592
2593
|
|
|
2593
|
-
def showsyntaxerror(self, filename=None):
|
|
2594
|
+
def showsyntaxerror(self, filename=None, **kwargs):
|
|
2594
2595
|
"""Display the syntax error that just occurred.
|
|
2595
2596
|
|
|
2596
2597
|
(override) Pass the syntax error info to the parent:shell.
|
|
2597
2598
|
"""
|
|
2598
|
-
interpreter.Interpreter.showsyntaxerror(self, filename)
|
|
2599
|
+
interpreter.Interpreter.showsyntaxerror(self, filename, **kwargs)
|
|
2599
2600
|
|
|
2600
2601
|
t, v, tb = sys.exc_info()
|
|
2601
2602
|
try:
|
|
@@ -3328,7 +3329,7 @@ class Nautilus(EditorInterface, Shell):
|
|
|
3328
3329
|
|
|
3329
3330
|
def on_interp_error(self, e):
|
|
3330
3331
|
ln = self.LineFromPosition(self.bolc)
|
|
3331
|
-
self.
|
|
3332
|
+
self.red_pointer = ln + e.lineno - 1
|
|
3332
3333
|
|
|
3333
3334
|
## --------------------------------
|
|
3334
3335
|
## Attributes of the shell
|
|
@@ -3652,11 +3653,11 @@ class Nautilus(EditorInterface, Shell):
|
|
|
3652
3653
|
lines = [int(ln) for fn, ln in err if fn == filename]
|
|
3653
3654
|
if lines:
|
|
3654
3655
|
region = self.get_region(self.cline)
|
|
3655
|
-
|
|
3656
|
+
lx = region[0] + lines[-1] - 1
|
|
3657
|
+
self.red_pointer = lx
|
|
3656
3658
|
self.message(e)
|
|
3657
|
-
## print(msg, file=sys.__stderr__)
|
|
3658
3659
|
else:
|
|
3659
|
-
del self.
|
|
3660
|
+
del self.red_pointer
|
|
3660
3661
|
self.message("Evaluated {!r} successfully.".format(filename))
|
|
3661
3662
|
else:
|
|
3662
3663
|
self.message("No region")
|
mwx/utilus.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mwxlib
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.0rc0
|
|
4
4
|
Summary: A wrapper of matplotlib and wxPython (phoenix)
|
|
5
5
|
Home-page: https://github.com/komoto48g/mwxlib
|
|
6
6
|
Author: Kazuya O'moto
|
|
@@ -39,22 +39,17 @@ These instructions will get you a copy of the project up and running on your loc
|
|
|
39
39
|
- ~~Python 2.7~~ (PY2 support has ended since 0.50)
|
|
40
40
|
- ~~Python 3.5~~ (PY35 support has ended since 0.70)
|
|
41
41
|
- ~~Python 3.7~~ (PY37 support has ended since 0.80)
|
|
42
|
-
- Python 3.8 -- 3.9 (
|
|
43
|
-
|
|
42
|
+
- ~~Python 3.8 -- 3.9~~ (Deprecated since 0.90)
|
|
43
|
+
- Python 3.10 -- 3.12
|
|
44
|
+
- wxpython >= 4.2.2 (recommended)
|
|
44
45
|
- numpy
|
|
45
46
|
- pillow
|
|
46
47
|
- matplotlib
|
|
47
48
|
- opencv-python
|
|
48
|
-
- Python 3.
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
- matplotlib
|
|
53
|
-
- opencv-python
|
|
54
|
-
- Python 3.12
|
|
55
|
-
- A version of wxpython for PY312 has not yet released on PyPi.
|
|
56
|
-
* You can download the snapshot from https://wxpython.org/Phoenix/snapshot-builds/,
|
|
57
|
-
* or the latest snapshot from Azure Pipelines https://alldunn.visualstudio.com/wxPython-CI/_build?definitionId=2&_a=summary
|
|
49
|
+
- Python 3.13
|
|
50
|
+
- There are some bugs in mwxlib that remain unfixed.
|
|
51
|
+
- A version of wxpython for PY313 has released on PyPi.
|
|
52
|
+
* You can also download the snapshot from https://wxpython.org/Phoenix/snapshot-builds/,
|
|
58
53
|
|
|
59
54
|
|
|
60
55
|
### Installing
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
mwx/__init__.py,sha256=
|
|
1
|
+
mwx/__init__.py,sha256=UXTLNsL0b8VOXhdqAHiuo1GKxMQWq1TaVKkINq03AGM,679
|
|
2
2
|
mwx/bookshelf.py,sha256=so-xSLq08sMlJBErTxOaDoKUAMa_g1CkIP2pNnff68c,5607
|
|
3
|
-
mwx/controls.py,sha256=
|
|
4
|
-
mwx/framework.py,sha256
|
|
3
|
+
mwx/controls.py,sha256=LZqee9K8uPxs-Iqcp1zMMNBjFpGPrHbcMaIBuBOL7oo,47647
|
|
4
|
+
mwx/framework.py,sha256=-NQE0fAqjXC6sTnoTa3BokVqILEBaqeUGuvklN2vkS8,76528
|
|
5
5
|
mwx/graphman.py,sha256=qX5aHEw4u9iGR8lNpZkXDnGPVMhyAH6NnBapiaUbKZw,70265
|
|
6
6
|
mwx/images.py,sha256=_-Eh3xF7Khu42ivkYp97NXIzSNGbjcidqtWjZQFGtqE,47827
|
|
7
|
-
mwx/matplot2.py,sha256=
|
|
7
|
+
mwx/matplot2.py,sha256=zA56jIdRUdzu-wrmPai1PSOjzqV2Erqw2yFKW-jwdA8,32901
|
|
8
8
|
mwx/matplot2g.py,sha256=gCXa8X1MEMP7n_mG73h3SkWKuNZOfjVKUTWNRXXK11c,64310
|
|
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/utilus.py,sha256=
|
|
11
|
+
mwx/nutshell.py,sha256=JcXgTsWPtd7k44UpBaDzNL4-cISWte-HDIhbUSWbj8g,141823
|
|
12
|
+
mwx/utilus.py,sha256=Yyw8L1f-ikhyd7wtFXYtsOswofWxmB4GAmLOZnhUXeU,37388
|
|
13
13
|
mwx/wxmon.py,sha256=yzWqrbY6LzpfRwQeytYUeqFhFuLVm_XEvrVAL_k0HBQ,12756
|
|
14
14
|
mwx/wxpdb.py,sha256=lLowkkAgMhPFHAfklD7wZHq0qbSMjRxnBFtSajmVgME,19133
|
|
15
15
|
mwx/wxwil.py,sha256=hhyB1lPrF9ixeObxCOKQv0Theu-B-kpJg_yVU3EGSNg,5406
|
|
@@ -21,8 +21,8 @@ mwx/plugins/frame_listview.py,sha256=yEYPCdLHLSMTJwTv6iYAh3Lo4lJvYfp5BxTLP3FhW9Y
|
|
|
21
21
|
mwx/plugins/line_profile.py,sha256=--9NIc3x5EfRB3L59JvD7rzENQHyiYfu7wWJo6AuMkA,820
|
|
22
22
|
mwx/py/__init__.py,sha256=xykgfOytOwNuvXsfkLoumFZSTN-iBsHOjczYXngjmUE,12
|
|
23
23
|
mwx/py/filling.py,sha256=fumUG1F5M9TL-Dfqni4G85uk7TmvnUunTbdcPDV0vfo,16857
|
|
24
|
-
mwxlib-
|
|
25
|
-
mwxlib-
|
|
26
|
-
mwxlib-
|
|
27
|
-
mwxlib-
|
|
28
|
-
mwxlib-
|
|
24
|
+
mwxlib-1.0rc0.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
|
|
25
|
+
mwxlib-1.0rc0.dist-info/METADATA,sha256=Aq235XvybcNr2GuQuxEhUGyjYj0K9NMeiGqQckJYTzk,7260
|
|
26
|
+
mwxlib-1.0rc0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
27
|
+
mwxlib-1.0rc0.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
|
|
28
|
+
mwxlib-1.0rc0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|