mwxlib 0.99.9__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 CHANGED
@@ -4,7 +4,7 @@
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
mwx/framework.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #! python3
2
2
  """mwxlib framework.
3
3
  """
4
- __version__ = "0.99.9"
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/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, 255)
639
- self.IndicatorSetOutlineAlpha(11, 255)
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
- self.red_pointer = -1
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
- v.lineno = tb.tb_next.tb_lineno
2587
- v.filename = tb.tb_next.tb_frame.f_code.co_filename
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.pointer = ln + e.lineno - 1
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
- self.pointer = region[0] + lines[-1] - 1
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.pointer
3660
+ del self.red_pointer
3660
3661
  self.message("Evaluated {!r} successfully.".format(filename))
3661
3662
  else:
3662
3663
  self.message("No region")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mwxlib
3
- Version: 0.99.9
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 (deprecated since 0.90)
43
- - wxpython >= 4.1.1
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.10 -- 3.11
49
- - wxpython >= 4.2.1
50
- - numpy
51
- - pillow
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,14 +1,14 @@
1
- mwx/__init__.py,sha256=psabnAMei5VzB2TsB2qBNLrIZMX0LiqjlXCpNGmDejk,668
1
+ mwx/__init__.py,sha256=UXTLNsL0b8VOXhdqAHiuo1GKxMQWq1TaVKkINq03AGM,679
2
2
  mwx/bookshelf.py,sha256=so-xSLq08sMlJBErTxOaDoKUAMa_g1CkIP2pNnff68c,5607
3
3
  mwx/controls.py,sha256=LZqee9K8uPxs-Iqcp1zMMNBjFpGPrHbcMaIBuBOL7oo,47647
4
- mwx/framework.py,sha256=nJ22_22Hk2U8xSbHOszluJdSMDwYsw6XjI3lOiprcJc,75501
4
+ mwx/framework.py,sha256=-NQE0fAqjXC6sTnoTa3BokVqILEBaqeUGuvklN2vkS8,76528
5
5
  mwx/graphman.py,sha256=qX5aHEw4u9iGR8lNpZkXDnGPVMhyAH6NnBapiaUbKZw,70265
6
6
  mwx/images.py,sha256=_-Eh3xF7Khu42ivkYp97NXIzSNGbjcidqtWjZQFGtqE,47827
7
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=zJULq1K8WiOBUncMpXE8HbunqUULa9MUt0hBET5jmgs,141810
11
+ mwx/nutshell.py,sha256=JcXgTsWPtd7k44UpBaDzNL4-cISWte-HDIhbUSWbj8g,141823
12
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
@@ -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-0.99.9.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
- mwxlib-0.99.9.dist-info/METADATA,sha256=1-yAjrG-AehfMfbbEyPN3eMtrGErVkNft7OHtTkwSU0,7411
26
- mwxlib-0.99.9.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
27
- mwxlib-0.99.9.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
- mwxlib-0.99.9.dist-info/RECORD,,
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,,