mwxlib 0.95.6__py3-none-any.whl → 0.95.8__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
@@ -7,20 +7,12 @@ from .framework import Menu, MenuBar, StatusBar
7
7
  from .framework import Frame, MiniFrame, ShellFrame, deb
8
8
 
9
9
  ## Controls
10
- ## from . import controls
11
10
  from .controls import Param, LParam, Knob, ControlPanel, Clipboard, Icon
12
11
  from .controls import Button, ToggleButton, TextCtrl, Choice, Gauge, Indicator
13
12
 
14
13
  ## Plugman
15
- ## from . import graphman
16
- ## from .graphman import Frame as ViewFrame, Layer, Thread, Graph
17
-
18
- ## Matplot
19
- ## from .matplot2 import MatplotPanel
20
- ## from .matplot2g import GraphPlot
21
- ## from .matplot2lg import LinePlot
22
- ## from .matplot2lg import Histogram
23
- ## from .matplot2lg import LineProfile
14
+ ## from .graphman import Frame as GraphmanFrame, Layer, Thread, Graph
15
+ ## from .graphman import MatplotPanel, GraphPlot, LinePlot, LineProfile, Histogram
24
16
 
25
17
  ## Gnuplot
26
18
  ## from .mgplt import Gnuplot, GnuplotFrame
mwx/controls.py CHANGED
@@ -936,9 +936,7 @@ def _getBitmap1(key, size=(16,16)):
936
936
  if key:
937
937
  try:
938
938
  art = _custom_images.get(key)
939
- bmp = (art.GetImage()
940
- .Scale(*size, wx.IMAGE_QUALITY_NEAREST)
941
- .ConvertToBitmap())
939
+ bmp = art.GetBitmap()
942
940
  except Exception:
943
941
  art = _provided_arts.get(key)
944
942
  bmp = wx.ArtProvider.GetBitmap(art or key, wx.ART_OTHER, size)
mwx/framework.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #! python3
2
2
  """mwxlib framework.
3
3
  """
4
- __version__ = "0.95.6"
4
+ __version__ = "0.95.8"
5
5
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
6
6
 
7
7
  from functools import wraps, partial
mwx/graphman.py CHANGED
@@ -4,7 +4,7 @@
4
4
  from functools import wraps
5
5
  from importlib import reload, import_module
6
6
  from contextlib import contextmanager
7
- from pprint import pprint, pformat
7
+ from pprint import pformat
8
8
  from bdb import BdbQuit
9
9
  import subprocess
10
10
  import threading
@@ -29,7 +29,11 @@ from . import framework as mwx
29
29
  from .utilus import funcall as _F
30
30
  from .controls import ControlPanel, Icon
31
31
  from .framework import CtrlInterface, AuiNotebook
32
+
33
+ from .matplot2 import MatplotPanel # noqa
32
34
  from .matplot2g import GraphPlot
35
+ from .matplot2lg import LinePlot # noqa
36
+ from .matplot2lg import LineProfile # noqa
33
37
  from .matplot2lg import Histogram
34
38
 
35
39
 
@@ -1531,8 +1535,7 @@ class Frame(mwx.Frame):
1531
1535
  new.update(res) # copy res back keeping new order.
1532
1536
 
1533
1537
  with open(filename, 'w') as o:
1534
- ## pprint(new, stream=o, sort_dicts=False) # write new <dict> PY38
1535
- pprint(tuple(new.items()), stream=o)
1538
+ print(pformat(tuple(new.items())), file=o)
1536
1539
 
1537
1540
  except Exception as e:
1538
1541
  print("- Failed to write attributes:", e)
mwx/matplot2.py CHANGED
@@ -38,17 +38,32 @@ if matplotlib.parse_version(matplotlib.__version__).release < (3,8,0):
38
38
  if 1:
39
39
  class Cursor(Cursor):
40
40
  def onmove(self, event):
41
- if self.ignore(event)\
42
- or not self.canvas.widgetlock.available(self):
41
+ """Internal event handler to draw the cursor when the mouse moves.
42
+ (override) If the cursor is off the axes, the xdata and ydata will
43
+ be None, and will simply be cleared rather than drawn.
44
+ """
45
+ if self.ignore(event):
43
46
  return
47
+ if not self.canvas.widgetlock.available(self):
48
+ return
49
+
44
50
  ## xdata, ydata = self._get_data_coords(event) # >= 3.8 only
45
51
  xdata, ydata = event.xdata, event.ydata
46
52
  self.linev.set_xdata((xdata, xdata))
47
53
  self.linev.set_visible(self.visible and self.vertOn)
48
54
  self.lineh.set_ydata((ydata, ydata))
49
55
  self.lineh.set_visible(self.visible and self.horizOn)
50
- if self.visible and (self.vertOn or self.horizOn):
51
- self._update()
56
+ if not (self.visible and (self.vertOn or self.horizOn)):
57
+ return
58
+ ## Redraw.
59
+ if self.useblit:
60
+ if self.background is not None:
61
+ self.canvas.restore_region(self.background)
62
+ self.ax.draw_artist(self.linev)
63
+ self.ax.draw_artist(self.lineh)
64
+ self.canvas.blit(self.ax.bbox)
65
+ else:
66
+ self.canvas.draw_idle()
52
67
 
53
68
 
54
69
  class MatplotPanel(wx.Panel):
@@ -152,8 +167,8 @@ class MatplotPanel(wx.Panel):
152
167
  'canvas_draw' : [ None, self.OnDraw ], # before canvas.draw
153
168
  #'canvas_drawn' : [ None, ], # after canvas.draw
154
169
  #'canvas_resized' : [ None, ],
155
- 'focus_set' : [ None, self.on_focus_set, self.escape ],
156
- 'focus_kill' : [ None, self.on_focus_kill, self.escape ],
170
+ 'focus_set' : [ None, self.on_focus_set ],
171
+ 'focus_kill' : [ None, self.on_focus_kill ],
157
172
  'figure_enter' : [ None, self.on_figure_enter ],
158
173
  'figure_leave' : [ None, self.on_figure_leave ],
159
174
  'axes_enter' : [ None, ],
mwx/matplot2g.py CHANGED
@@ -888,6 +888,7 @@ class GraphPlot(MatplotPanel):
888
888
  MatplotPanel.on_focus_set(self, evt)
889
889
  if self.frame:
890
890
  self.handler('frame_selected', self.frame)
891
+ self.on_picker_unlock(evt)
891
892
  self.trace_point(*self.Selector)
892
893
 
893
894
  def on_focus_kill(self, evt):
@@ -895,6 +896,7 @@ class GraphPlot(MatplotPanel):
895
896
  MatplotPanel.on_focus_kill(self, evt)
896
897
  if self.frame:
897
898
  self.handler('frame_deselected', self.frame)
899
+ self.on_picker_lock(evt)
898
900
 
899
901
  def get_cmap(self):
900
902
  if self.frame:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mwxlib
3
- Version: 0.95.6
3
+ Version: 0.95.8
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
@@ -1,11 +1,11 @@
1
- mwx/__init__.py,sha256=SNSLQc0IGuE6LDT5mzaAxXRgcH_k6cRVS3gXzFQqdZM,814
1
+ mwx/__init__.py,sha256=nN62CGTWjME7Zz2h-jIRB8MxwuErIkHPGrlBzydkF0o,643
2
2
  mwx/bookshelf.py,sha256=DAhMQk3_J4rdE50adBMFu5wNz3WdMh_zzJ37O9ncceo,5103
3
- mwx/controls.py,sha256=9nxVBNXcyZjZT4XBtBJfuzRqTB5X5rkZR3pnHPE9WaI,48289
4
- mwx/framework.py,sha256=bEb_aHtPTFowVMELMmlFvdm2Edmkw8mfPvRQJ907ulQ,75669
5
- mwx/graphman.py,sha256=OMO2HQGfeCCGON8MwabmhLYsA-YHKueKaepsJkTDP0c,70489
3
+ mwx/controls.py,sha256=ejttyU7pC50tr71cOWQj9ImN_AMeTKtQWozPD8pLwhE,48183
4
+ mwx/framework.py,sha256=ITmjul_u4gp9jAJ_qbCDUVhlLI02cFhLLABCbYS-13k,75669
5
+ mwx/graphman.py,sha256=NBe58KdAstFNPqyEmpPMMmWwjtNgJB7HumSI7-gjw54,70533
6
6
  mwx/images.py,sha256=gyvqW4TLWdJMKmsaWiPiV_PuHJM1GbHgeELERLwGzg8,45291
7
- mwx/matplot2.py,sha256=nA7RLW1tf5kQfrenFnrAF900DbrpOUldc3SGaJgJKi0,32794
8
- mwx/matplot2g.py,sha256=faKpuBdp4H_g-HKfRdxV17AwHtXcfRi2F0myE3cjM04,65393
7
+ mwx/matplot2.py,sha256=1ISXVwqlu1EJKe5JXmBC2tuecsRoFzJrMZsqQMxdC50,33432
8
+ mwx/matplot2g.py,sha256=KIuownEsF7t2RgHn3kOxjBXbKOdfS99X_CtQweG_FrM,65471
9
9
  mwx/matplot2lg.py,sha256=gI_L_GofQrg5TIgZFMgYu8-7IRoe6VCRG3Ub35ChSpQ,27177
10
10
  mwx/mgplt.py,sha256=ITzxA97yDwr_35BUk5OqnyskSuKVDbpf2AQCKY1jHTI,5671
11
11
  mwx/nutshell.py,sha256=xI5o9os0wxgkY5LFz1wztM36l-4nl2j1iAdzJ11BMv0,137104
@@ -21,8 +21,8 @@ mwx/plugins/frame_listview.py,sha256=RaYOj-YKrpLqhT8TkBRDX1TQnSPv90V185j8OjrWJTs
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=KaHooM32hrGGgqw75Cbt8lAvACwC6RXadob9LGgNnEc,16806
24
- mwxlib-0.95.6.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
- mwxlib-0.95.6.dist-info/METADATA,sha256=oWMpii7LOaEx62rOLP7IERjo59bWV0VLVEBt2Ju2xa0,1925
26
- mwxlib-0.95.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
27
- mwxlib-0.95.6.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
- mwxlib-0.95.6.dist-info/RECORD,,
24
+ mwxlib-0.95.8.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
+ mwxlib-0.95.8.dist-info/METADATA,sha256=_rLSaOpBEIzfQxz1acUok9ODoGNNth0lRqmIOLZv0Xs,1925
26
+ mwxlib-0.95.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
27
+ mwxlib-0.95.8.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
+ mwxlib-0.95.8.dist-info/RECORD,,