mwxlib 0.93.9__py3-none-any.whl → 0.94.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 +1 -44
- mwx/controls.py +2 -2
- mwx/framework.py +57 -15
- mwx/graphman.py +12 -16
- mwx/nutshell.py +13 -14
- mwx/utilus.py +16 -3
- {mwxlib-0.93.9.dist-info → mwxlib-0.94.2.dist-info}/METADATA +1 -1
- {mwxlib-0.93.9.dist-info → mwxlib-0.94.2.dist-info}/RECORD +11 -11
- {mwxlib-0.93.9.dist-info → mwxlib-0.94.2.dist-info}/LICENSE +0 -0
- {mwxlib-0.93.9.dist-info → mwxlib-0.94.2.dist-info}/WHEEL +0 -0
- {mwxlib-0.93.9.dist-info → mwxlib-0.94.2.dist-info}/top_level.txt +0 -0
mwx/__init__.py
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
from .framework import __version__, __author__
|
|
5
5
|
from .framework import FSM
|
|
6
6
|
from .framework import Menu, MenuBar, StatusBar
|
|
7
|
-
from .framework import App, Frame, MiniFrame, ShellFrame
|
|
7
|
+
from .framework import deb, App, Frame, MiniFrame, ShellFrame
|
|
8
8
|
|
|
9
9
|
## Controls
|
|
10
10
|
## from . import controls
|
|
@@ -25,46 +25,3 @@ from .framework import App, Frame, MiniFrame, ShellFrame
|
|
|
25
25
|
## Gnuplot
|
|
26
26
|
## from .mgplt import Gnuplot
|
|
27
27
|
## from .mgplt import GnuplotFrame
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def deb(target=None, loop=True, locals=None, **kwargs):
|
|
31
|
-
"""Dive into the process.
|
|
32
|
-
|
|
33
|
-
Args:
|
|
34
|
-
target : Object or module (default None).
|
|
35
|
-
If None, the target is set to `__main__`.
|
|
36
|
-
loop : If True, the app and the mainloop will be created.
|
|
37
|
-
Otherwise, neither the app nor the mainloop will be created.
|
|
38
|
-
locals : Additional context of the shell
|
|
39
|
-
|
|
40
|
-
**kwargs: Nautilus arguments
|
|
41
|
-
|
|
42
|
-
- introText : introductory of the shell
|
|
43
|
-
- startupScript : startup script file (default None)
|
|
44
|
-
- execStartupScript : True => Execute the startup script.
|
|
45
|
-
- ensureClose : True => EVT_CLOSE will close the window.
|
|
46
|
-
False => EVT_CLOSE will hide the window.
|
|
47
|
-
|
|
48
|
-
Note:
|
|
49
|
-
This will execute the startup script $(PYTHONSTARTUP).
|
|
50
|
-
"""
|
|
51
|
-
import wx
|
|
52
|
-
|
|
53
|
-
quote_unqoute = """
|
|
54
|
-
Anything one man can imagine, other man can make real.
|
|
55
|
-
--- Jules Verne (1828--1905)
|
|
56
|
-
"""
|
|
57
|
-
kwargs.setdefault("introText",
|
|
58
|
-
"mwx {}".format(__version__) + quote_unqoute)
|
|
59
|
-
kwargs.setdefault("execStartupScript", True)
|
|
60
|
-
kwargs.setdefault("ensureClose", True)
|
|
61
|
-
|
|
62
|
-
app = wx.GetApp() or wx.App()
|
|
63
|
-
frame = ShellFrame(None, target, **kwargs)
|
|
64
|
-
frame.Show()
|
|
65
|
-
frame.rootshell.SetFocus()
|
|
66
|
-
if locals:
|
|
67
|
-
frame.rootshell.locals.update(locals)
|
|
68
|
-
if loop and not app.GetMainLoop():
|
|
69
|
-
app.MainLoop()
|
|
70
|
-
return frame
|
mwx/controls.py
CHANGED
|
@@ -1119,7 +1119,7 @@ class Choice(wx.Control):
|
|
|
1119
1119
|
|
|
1120
1120
|
Selection = property(
|
|
1121
1121
|
lambda self: self._ctrl.GetSelection(),
|
|
1122
|
-
lambda self,v: self._ctrl.SetSelection(v),
|
|
1122
|
+
lambda self,v: self._ctrl.SetSelection(v), # int or NOT_FOUND(-1)
|
|
1123
1123
|
doc="combobox selection:int")
|
|
1124
1124
|
|
|
1125
1125
|
Items = property(
|
|
@@ -1199,7 +1199,7 @@ class Indicator(wx.Control):
|
|
|
1199
1199
|
self.__value = int(v)
|
|
1200
1200
|
self.Refresh()
|
|
1201
1201
|
|
|
1202
|
-
def
|
|
1202
|
+
def update_design(self, **kwargs):
|
|
1203
1203
|
"""Update design attributes.
|
|
1204
1204
|
|
|
1205
1205
|
This method is useful for changing colors, spacing, radius, etc.
|
mwx/framework.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#! python3
|
|
2
2
|
"""mwxlib framework.
|
|
3
3
|
"""
|
|
4
|
-
__version__ = "0.
|
|
4
|
+
__version__ = "0.94.2"
|
|
5
5
|
__author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
|
|
6
6
|
|
|
7
7
|
from functools import wraps, partial
|
|
@@ -26,6 +26,47 @@ from .utilus import FSM, TreeList, apropos, typename, where, mro, pp
|
|
|
26
26
|
from .utilus import get_rootpath
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
def deb(target=None, loop=True, locals=None, **kwargs):
|
|
30
|
+
"""Dive into the process.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
target : Object or module (default None).
|
|
34
|
+
If None, the target is set to `__main__`.
|
|
35
|
+
loop : If True, the app and the mainloop will be created.
|
|
36
|
+
Otherwise, neither the app nor the mainloop will be created.
|
|
37
|
+
locals : Additional context of the shell
|
|
38
|
+
|
|
39
|
+
**kwargs: Nautilus arguments
|
|
40
|
+
|
|
41
|
+
- introText : introductory of the shell
|
|
42
|
+
- startupScript : startup script file (default None)
|
|
43
|
+
- execStartupScript : True => Execute the startup script.
|
|
44
|
+
- ensureClose : True => EVT_CLOSE will close the window.
|
|
45
|
+
False => EVT_CLOSE will hide the window.
|
|
46
|
+
|
|
47
|
+
Note:
|
|
48
|
+
This will execute the startup script $(PYTHONSTARTUP).
|
|
49
|
+
"""
|
|
50
|
+
import wx
|
|
51
|
+
|
|
52
|
+
quote_unqoute = """
|
|
53
|
+
Anything one man can imagine, other man can make real.
|
|
54
|
+
--- Jules Verne (1828--1905)
|
|
55
|
+
"""
|
|
56
|
+
kwargs.setdefault("introText",
|
|
57
|
+
"mwx {}".format(__version__) + quote_unqoute)
|
|
58
|
+
kwargs.setdefault("execStartupScript", True)
|
|
59
|
+
kwargs.setdefault("ensureClose", True)
|
|
60
|
+
|
|
61
|
+
with App(loop):
|
|
62
|
+
frame = ShellFrame(None, target, **kwargs)
|
|
63
|
+
frame.Show()
|
|
64
|
+
frame.rootshell.SetFocus()
|
|
65
|
+
if locals:
|
|
66
|
+
frame.rootshell.locals.update(locals)
|
|
67
|
+
return frame
|
|
68
|
+
|
|
69
|
+
|
|
29
70
|
@contextmanager
|
|
30
71
|
def App(loop=True):
|
|
31
72
|
app = wx.GetApp() or wx.App()
|
|
@@ -975,7 +1016,7 @@ class FileDropLoader(wx.DropTarget):
|
|
|
975
1016
|
def __init__(self, target):
|
|
976
1017
|
wx.DropTarget.__init__(self)
|
|
977
1018
|
|
|
978
|
-
self.
|
|
1019
|
+
self.book = target
|
|
979
1020
|
self.textdo = wx.TextDataObject()
|
|
980
1021
|
self.filedo = wx.FileDataObject()
|
|
981
1022
|
self.DataObject = wx.DataObjectComposite()
|
|
@@ -983,25 +1024,26 @@ class FileDropLoader(wx.DropTarget):
|
|
|
983
1024
|
self.DataObject.Add(self.filedo, True)
|
|
984
1025
|
|
|
985
1026
|
def OnData(self, x, y, result):
|
|
1027
|
+
editor = self.book
|
|
986
1028
|
self.GetData()
|
|
987
1029
|
if self.textdo.TextLength > 1:
|
|
988
1030
|
f = self.textdo.Text.strip()
|
|
989
|
-
res =
|
|
1031
|
+
res = editor.load_file(f)
|
|
990
1032
|
if res:
|
|
991
|
-
|
|
1033
|
+
editor.buffer.SetFocus()
|
|
992
1034
|
result = wx.DragCopy
|
|
993
1035
|
elif res is None:
|
|
994
|
-
|
|
1036
|
+
editor.post_message("Load canceled.")
|
|
995
1037
|
result = wx.DragCancel
|
|
996
1038
|
else:
|
|
997
|
-
|
|
1039
|
+
editor.post_message(f"Loading {f!r} failed.")
|
|
998
1040
|
result = wx.DragNone
|
|
999
1041
|
self.textdo.Text = ''
|
|
1000
1042
|
else:
|
|
1001
1043
|
for f in self.filedo.Filenames:
|
|
1002
|
-
if
|
|
1003
|
-
|
|
1004
|
-
|
|
1044
|
+
if editor.load_file(f):
|
|
1045
|
+
editor.buffer.SetFocus()
|
|
1046
|
+
editor.post_message(f"Loaded {f!r} successfully.")
|
|
1005
1047
|
self.filedo.SetData(wx.DF_FILENAME, None)
|
|
1006
1048
|
return result
|
|
1007
1049
|
|
|
@@ -1236,9 +1278,9 @@ class ShellFrame(MiniFrame):
|
|
|
1236
1278
|
shell = self.current_shell
|
|
1237
1279
|
self.Scratch.buffer.py_eval_line(shell.globals, shell.locals)
|
|
1238
1280
|
|
|
1239
|
-
@self.Scratch.define_key('
|
|
1281
|
+
@self.Scratch.define_key('C-S-j')
|
|
1240
1282
|
@postcall
|
|
1241
|
-
def
|
|
1283
|
+
def eval_buffer():
|
|
1242
1284
|
shell = self.current_shell
|
|
1243
1285
|
self.Scratch.buffer.py_exec_region(shell.globals, shell.locals)
|
|
1244
1286
|
|
|
@@ -1487,26 +1529,26 @@ class ShellFrame(MiniFrame):
|
|
|
1487
1529
|
evt.Skip()
|
|
1488
1530
|
|
|
1489
1531
|
def About(self, evt=None):
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
buf.SetText('\n\n'.join((
|
|
1532
|
+
self.add_help(
|
|
1533
|
+
'\n\n'.join((
|
|
1493
1534
|
"#<module 'mwx' from {!r}>".format(__file__),
|
|
1494
1535
|
"Author: {!r}".format(__author__),
|
|
1495
1536
|
"Version: {!s}".format(__version__),
|
|
1496
1537
|
self.__class__.__doc__,
|
|
1497
1538
|
self.rootshell.__class__.__doc__,
|
|
1539
|
+
|
|
1498
1540
|
## Thanks to wx.py.shell.
|
|
1499
1541
|
"#{!r}".format(wx.py),
|
|
1500
1542
|
"Author: {!r}".format(wx.py.version.__author__),
|
|
1501
1543
|
"Version: {!s}".format(wx.py.version.VERSION),
|
|
1502
1544
|
wx.py.shell.Shell.__doc__,
|
|
1503
1545
|
textwrap.indent("*original" + wx.py.shell.HELP_TEXT, ' '*4),
|
|
1546
|
+
|
|
1504
1547
|
## Thanks are also due to wx.
|
|
1505
1548
|
"#{!r}".format(wx),
|
|
1506
1549
|
"To show the credit, press C-M-Mbutton.\n",
|
|
1507
1550
|
))
|
|
1508
1551
|
)
|
|
1509
|
-
self.popup_window(self.Help, focus=0)
|
|
1510
1552
|
|
|
1511
1553
|
def toggle_window(self, win, focus=False):
|
|
1512
1554
|
self.popup_window(win, show=None, focus=focus)
|
mwx/graphman.py
CHANGED
|
@@ -713,12 +713,12 @@ class Frame(mwx.Frame):
|
|
|
713
713
|
("Options", []), # reserved for optional app settings
|
|
714
714
|
(),
|
|
715
715
|
(mwx.ID_(13), "&Graph window\tF9", "Show graph window", wx.ITEM_CHECK,
|
|
716
|
-
lambda v: self.show_pane(
|
|
717
|
-
lambda v: v.Check(self.graph.
|
|
716
|
+
lambda v: self.show_pane(self.graph, v.IsChecked()),
|
|
717
|
+
lambda v: v.Check(self.graph.IsShownOnScreen())),
|
|
718
718
|
|
|
719
719
|
(mwx.ID_(14), "&Output window\tF10", "Show Output window", wx.ITEM_CHECK,
|
|
720
|
-
lambda v: self.show_pane(
|
|
721
|
-
lambda v: v.Check(self.output.
|
|
720
|
+
lambda v: self.show_pane(self.output, v.IsChecked()),
|
|
721
|
+
lambda v: v.Check(self.output.IsShownOnScreen())),
|
|
722
722
|
(),
|
|
723
723
|
]
|
|
724
724
|
self.menubar["Edit"] = [
|
|
@@ -743,8 +743,8 @@ class Frame(mwx.Frame):
|
|
|
743
743
|
lambda v: self.__view.hide_layers()),
|
|
744
744
|
(),
|
|
745
745
|
(mwx.ID_(24), "&Histogram\tCtrl-h", "Show Histogram window", wx.ITEM_CHECK,
|
|
746
|
-
lambda v: self.show_pane(
|
|
747
|
-
lambda v: v.Check(self.histogram.
|
|
746
|
+
lambda v: self.show_pane(self.histogram, v.IsChecked()),
|
|
747
|
+
lambda v: v.Check(self.histogram.IsShownOnScreen())),
|
|
748
748
|
|
|
749
749
|
(mwx.ID_(25), "&Invert Color\t(C-i)", "Invert colormap", wx.ITEM_CHECK,
|
|
750
750
|
lambda v: self.__view.invert_cmap(),
|
|
@@ -783,14 +783,14 @@ class Frame(mwx.Frame):
|
|
|
783
783
|
]
|
|
784
784
|
self.menubar.reset()
|
|
785
785
|
|
|
786
|
-
def
|
|
786
|
+
def show_frameview(frame):
|
|
787
787
|
wx.CallAfter(self.show_pane, frame.parent) # Show graph / output
|
|
788
788
|
|
|
789
789
|
self.graph.handler.append({ # DNA<Graph:Frame>
|
|
790
790
|
None : {
|
|
791
791
|
'frame_shown' : [ None, self.set_title ],
|
|
792
|
-
'frame_loaded' : [ None,
|
|
793
|
-
'frame_modified' : [ None,
|
|
792
|
+
'frame_loaded' : [ None, show_frameview ],
|
|
793
|
+
'frame_modified' : [ None, show_frameview ],
|
|
794
794
|
'frame_selected' : [ None, self.set_title ],
|
|
795
795
|
'canvas_draw' : [ None, lambda v: self.sync(self.graph, self.output) ],
|
|
796
796
|
},
|
|
@@ -798,8 +798,8 @@ class Frame(mwx.Frame):
|
|
|
798
798
|
self.output.handler.append({ # DNA<Graph:Frame>
|
|
799
799
|
None : {
|
|
800
800
|
'frame_shown' : [ None, self.set_title ],
|
|
801
|
-
'frame_loaded' : [ None,
|
|
802
|
-
'frame_modified' : [ None,
|
|
801
|
+
'frame_loaded' : [ None, show_frameview ],
|
|
802
|
+
'frame_modified' : [ None, show_frameview ],
|
|
803
803
|
'frame_selected' : [ None, self.set_title ],
|
|
804
804
|
'canvas_draw' : [ None, lambda v: self.sync(self.output, self.graph) ],
|
|
805
805
|
},
|
|
@@ -1802,16 +1802,12 @@ class Frame(mwx.Frame):
|
|
|
1802
1802
|
o.write("self.load_plug({!r}, session={})\n".format(path, session or None))
|
|
1803
1803
|
o.write("self._mgr.LoadPerspective({!r})\n".format(self._mgr.SavePerspective()))
|
|
1804
1804
|
|
|
1805
|
-
## set-global-unit
|
|
1806
|
-
o.write("self.graph.unit = {:g}\n".format(self.graph.unit))
|
|
1807
|
-
o.write("self.output.unit = {:g}\n".format(self.output.unit))
|
|
1808
|
-
|
|
1809
1805
|
## stack-frame
|
|
1810
1806
|
paths = [x.pathname for x in self.graph.all_frames if x.pathname]
|
|
1811
1807
|
if paths:
|
|
1812
1808
|
o.write("self.load_frame(\n{}, self.graph)\n".format(
|
|
1813
1809
|
pformat(paths, width=160)))
|
|
1814
|
-
|
|
1810
|
+
|
|
1815
1811
|
frame = self.graph.frame # restore currently selected frame
|
|
1816
1812
|
if frame and frame.pathname:
|
|
1817
1813
|
o.write("self.graph.select({!r})\n".format(frame.name))
|
mwx/nutshell.py
CHANGED
|
@@ -2220,8 +2220,8 @@ class Nautilus(Shell, EditorInterface):
|
|
|
2220
2220
|
|
|
2221
2221
|
C-up : [0] retrieve previous history
|
|
2222
2222
|
C-down : [0] retrieve next history
|
|
2223
|
-
C-j,
|
|
2224
|
-
C-h,
|
|
2223
|
+
C-j, C-S-j : [0] call tooltip of eval (for the word selected or focused)
|
|
2224
|
+
C-h, C-S-h : [0] call tooltip of help (for the func selected or focused)
|
|
2225
2225
|
TAB : [1] history-comp-mode
|
|
2226
2226
|
M-p : [1] retrieve previous history in comp-mode
|
|
2227
2227
|
M-n : [1] retrieve next history in comp-mode
|
|
@@ -2472,9 +2472,9 @@ class Nautilus(Shell, EditorInterface):
|
|
|
2472
2472
|
'S-insert pressed' : (0, _F(self.Paste)),
|
|
2473
2473
|
'C-S-insert pressed' : (0, _F(self.Paste, rectangle=1)),
|
|
2474
2474
|
'C-j pressed' : (0, self.eval_line),
|
|
2475
|
-
|
|
2475
|
+
'C-S-j pressed' : (0, self.exec_region),
|
|
2476
2476
|
'C-h pressed' : (0, self.call_helpTip),
|
|
2477
|
-
|
|
2477
|
+
'C-S-h pressed' : (0, self.call_helpTip2),
|
|
2478
2478
|
'. pressed' : (2, self.OnEnterDot),
|
|
2479
2479
|
'tab pressed' : (1, self.call_history_comp),
|
|
2480
2480
|
'M-p pressed' : (1, self.call_history_comp),
|
|
@@ -2531,9 +2531,9 @@ class Nautilus(Shell, EditorInterface):
|
|
|
2531
2531
|
'*backspace released' : (2, self.call_word_autocomp),
|
|
2532
2532
|
'C-S-backspace pressed' : (2, ),
|
|
2533
2533
|
'C-j pressed' : (2, self.eval_line),
|
|
2534
|
-
|
|
2534
|
+
'C-S-j pressed' : (2, self.exec_region),
|
|
2535
2535
|
'C-h pressed' : (2, self.call_helpTip),
|
|
2536
|
-
|
|
2536
|
+
'C-S-h pressed' : (2, self.call_helpTip2),
|
|
2537
2537
|
'*alt pressed' : (2, ),
|
|
2538
2538
|
'*ctrl pressed' : (2, ),
|
|
2539
2539
|
'*shift pressed' : (2, ),
|
|
@@ -2562,9 +2562,9 @@ class Nautilus(Shell, EditorInterface):
|
|
|
2562
2562
|
'*backspace released' : (3, self.call_apropos_autocomp),
|
|
2563
2563
|
'C-S-backspace pressed' : (3, ),
|
|
2564
2564
|
'C-j pressed' : (3, self.eval_line),
|
|
2565
|
-
|
|
2565
|
+
'C-S-j pressed' : (3, self.exec_region),
|
|
2566
2566
|
'C-h pressed' : (3, self.call_helpTip),
|
|
2567
|
-
|
|
2567
|
+
'C-S-h pressed' : (3, self.call_helpTip2),
|
|
2568
2568
|
'*alt pressed' : (3, ),
|
|
2569
2569
|
'*ctrl pressed' : (3, ),
|
|
2570
2570
|
'*shift pressed' : (3, ),
|
|
@@ -2593,9 +2593,9 @@ class Nautilus(Shell, EditorInterface):
|
|
|
2593
2593
|
'*backspace released' : (4, self.call_text_autocomp),
|
|
2594
2594
|
'C-S-backspace pressed' : (4, ),
|
|
2595
2595
|
'C-j pressed' : (4, self.eval_line),
|
|
2596
|
-
|
|
2596
|
+
'C-S-j pressed' : (4, self.exec_region),
|
|
2597
2597
|
'C-h pressed' : (4, self.call_helpTip),
|
|
2598
|
-
|
|
2598
|
+
'C-S-h pressed' : (4, self.call_helpTip2),
|
|
2599
2599
|
'*alt pressed' : (4, ),
|
|
2600
2600
|
'*ctrl pressed' : (4, ),
|
|
2601
2601
|
'*shift pressed' : (4, ),
|
|
@@ -2730,7 +2730,7 @@ class Nautilus(Shell, EditorInterface):
|
|
|
2730
2730
|
rst = self.get_style(p)
|
|
2731
2731
|
if p == self.bolc:
|
|
2732
2732
|
self.ReplaceSelection('self') # replace [.] --> [self.]
|
|
2733
|
-
elif st in ('nil', 'op', 'sep', 'lparen'):
|
|
2733
|
+
elif st in ('nil', 'space', 'op', 'sep', 'lparen'):
|
|
2734
2734
|
self.ReplaceSelection('self')
|
|
2735
2735
|
elif st not in ('moji', 'word', 'rparen') or rst == 'word':
|
|
2736
2736
|
self.handler('quit', evt) # don't enter autocomp
|
|
@@ -3307,13 +3307,12 @@ class Nautilus(Shell, EditorInterface):
|
|
|
3307
3307
|
|
|
3308
3308
|
text = self.SelectedText or self.Command or self.expr_at_caret
|
|
3309
3309
|
if text:
|
|
3310
|
+
text = introspect.getRoot(text, terminator='(')
|
|
3310
3311
|
try:
|
|
3311
|
-
text = introspect.getRoot(text, terminator='(')
|
|
3312
3312
|
obj = self.eval(text)
|
|
3313
|
+
self.help(obj)
|
|
3313
3314
|
except Exception as e:
|
|
3314
3315
|
self.message("- {} : {!r}".format(e, text))
|
|
3315
|
-
else:
|
|
3316
|
-
self.help(obj)
|
|
3317
3316
|
|
|
3318
3317
|
def call_helpTip(self, evt):
|
|
3319
3318
|
"""Show tooltips for the selected topic."""
|
mwx/utilus.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"""
|
|
4
4
|
from functools import wraps
|
|
5
5
|
from bdb import BdbQuit
|
|
6
|
+
from contextlib import contextmanager
|
|
6
7
|
import traceback
|
|
7
8
|
import warnings
|
|
8
9
|
import time
|
|
@@ -20,6 +21,20 @@ from inspect import (isclass, ismodule, ismethod, isbuiltin,
|
|
|
20
21
|
from pprint import pprint
|
|
21
22
|
|
|
22
23
|
|
|
24
|
+
@contextmanager
|
|
25
|
+
def ignore(*category):
|
|
26
|
+
"""Ignore warnings.
|
|
27
|
+
|
|
28
|
+
It can be used as decorators as well as in with statements.
|
|
29
|
+
cf. contextlib.suppress
|
|
30
|
+
|
|
31
|
+
Note:
|
|
32
|
+
ignore() does not ignore warnings.
|
|
33
|
+
ignore(Warning) ignores all warnings.
|
|
34
|
+
"""
|
|
35
|
+
with warnings.catch_warnings():
|
|
36
|
+
warnings.simplefilter("ignore", category)
|
|
37
|
+
yield
|
|
23
38
|
def atom(v):
|
|
24
39
|
return not hasattr(v, '__name__')
|
|
25
40
|
|
|
@@ -126,9 +141,7 @@ def apropos(obj, rexpr='', ignorecase=True, alias=None, pred=None, locals=None):
|
|
|
126
141
|
except (TypeError, ValueError):
|
|
127
142
|
pass
|
|
128
143
|
|
|
129
|
-
with
|
|
130
|
-
warnings.simplefilter('ignore', DeprecationWarning)
|
|
131
|
-
|
|
144
|
+
with ignore(DeprecationWarning):
|
|
132
145
|
print("matching to {!r} in {} {} :{}".format(
|
|
133
146
|
rexpr, name, type(obj), pred and pred.__name__))
|
|
134
147
|
try:
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
mwx/__init__.py,sha256=
|
|
1
|
+
mwx/__init__.py,sha256=zLsXDgqyC5NsPCjRxjS2huvZ3uDyeOJ1vapotqe2ULM,834
|
|
2
2
|
mwx/bookshelf.py,sha256=FrissUYdGXLABOzJmMaQU6GXvu6n_9DVW3d5wGwQzjM,6613
|
|
3
|
-
mwx/controls.py,sha256=
|
|
4
|
-
mwx/framework.py,sha256=
|
|
5
|
-
mwx/graphman.py,sha256=
|
|
3
|
+
mwx/controls.py,sha256=1eguX5eofsA6hmS2y7R4hvlFjFikVoZ8v2S1ES7rjEU,47196
|
|
4
|
+
mwx/framework.py,sha256=1QVxdGh9q2auq4hQV-DaJsAZellHuUd9jpYfPBUj0fA,75394
|
|
5
|
+
mwx/graphman.py,sha256=UsNBo5Z1eiuXj3VkxCZds_Uy8R0cQV7mXoCwLtejbCE,70001
|
|
6
6
|
mwx/images.py,sha256=mrnUYH12I3XLVSZcEXlpVltX0XMxufbl2yRvDIQJZqc,49957
|
|
7
7
|
mwx/matplot2.py,sha256=qaF_gvLoLn-TimLbRR59KUavNr1ZpZQdSMqjzJk47rk,32682
|
|
8
8
|
mwx/matplot2g.py,sha256=Ca-3RJZmSiZcvNrXmeK_lFf2fdG-0gkp7dYkCtrKi2I,65530
|
|
9
9
|
mwx/matplot2lg.py,sha256=tg8u7w4DxiJdPN-E197NOmbQpc_1gZkgDHYv_xUhbFA,27224
|
|
10
10
|
mwx/mgplt.py,sha256=ITzxA97yDwr_35BUk5OqnyskSuKVDbpf2AQCKY1jHTI,5671
|
|
11
|
-
mwx/nutshell.py,sha256=
|
|
12
|
-
mwx/utilus.py,sha256=
|
|
11
|
+
mwx/nutshell.py,sha256=iJEFzcu5qfp-HxXORB8ci-Q1z7a8zTPwbfFxik5h6pY,135802
|
|
12
|
+
mwx/utilus.py,sha256=5GVSNKyvNWxsDftIrTJUhBlnQAh3zvrW5BuQSGasJv8,37395
|
|
13
13
|
mwx/wxmon.py,sha256=Qk86VbuuW2rR46pqEYLur13G_aloWz5SVv6sib30YY0,12717
|
|
14
14
|
mwx/wxpdb.py,sha256=2z3ZD9Oo1H-ONBHlaprkB9hrTmAI7o03sqO46ppEFE4,19129
|
|
15
15
|
mwx/wxwil.py,sha256=JK1du4i1RVMbDLqN8jLRDSu_JhKEp4mhHVMElzo4yoE,5578
|
|
@@ -21,8 +21,8 @@ mwx/plugins/frame_listview.py,sha256=T-2xSv_D2bk9fJ64aiSEe1rJRTeqaIpLVAYEUXW5vz8
|
|
|
21
21
|
mwx/plugins/line_profile.py,sha256=WJB5z7F53yg4dII2R36IFZvtkSOGWT669b1HmAAXSnQ,816
|
|
22
22
|
mwx/py/__init__.py,sha256=xykgfOytOwNuvXsfkLoumFZSTN-iBsHOjczYXngjmUE,12
|
|
23
23
|
mwx/py/filling.py,sha256=KaHooM32hrGGgqw75Cbt8lAvACwC6RXadob9LGgNnEc,16806
|
|
24
|
-
mwxlib-0.
|
|
25
|
-
mwxlib-0.
|
|
26
|
-
mwxlib-0.
|
|
27
|
-
mwxlib-0.
|
|
28
|
-
mwxlib-0.
|
|
24
|
+
mwxlib-0.94.2.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
|
|
25
|
+
mwxlib-0.94.2.dist-info/METADATA,sha256=nG8tQUyP23iDpjnaedgv9mFikcFoIBpFhFhfgI0wlWY,1925
|
|
26
|
+
mwxlib-0.94.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
27
|
+
mwxlib-0.94.2.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
|
|
28
|
+
mwxlib-0.94.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|