mwxlib 0.95.9__py3-none-any.whl → 0.96.0__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/framework.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #! python3
2
2
  """mwxlib framework.
3
3
  """
4
- __version__ = "0.95.9"
4
+ __version__ = "0.96.0"
5
5
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
6
6
 
7
7
  from functools import wraps, partial
@@ -1131,7 +1131,7 @@ class ShellFrame(MiniFrame):
1131
1131
  stdout=self.__shell.interp.stdout,
1132
1132
  skip=[Debugger.__module__, # Don't enter debugger
1133
1133
  EventMonitor.__module__, # Don't enter event-hook
1134
- ## FSM.__module__,
1134
+ FSM.__module__,
1135
1135
  'fnmatch', 'warnings', 'bdb', 'pdb',
1136
1136
  'wx.core', 'wx.lib.eventwatcher',
1137
1137
  ],
mwx/graphman.py CHANGED
@@ -28,7 +28,7 @@ from PIL.TiffImagePlugin import TiffImageFile
28
28
  from . import framework as mwx
29
29
  from .utilus import funcall as _F
30
30
  from .controls import ControlPanel, Icon
31
- from .framework import CtrlInterface, AuiNotebook
31
+ from .framework import CtrlInterface, AuiNotebook, Menu, FSM
32
32
 
33
33
  from .matplot2 import MatplotPanel # noqa
34
34
  from .matplot2g import GraphPlot
@@ -96,7 +96,7 @@ class Thread(object):
96
96
  try:
97
97
  self.handler = self.owner.handler
98
98
  except AttributeError:
99
- self.handler = mwx.FSM({ # DNA<Thread>
99
+ self.handler = FSM({ # DNA<Thread>
100
100
  None : {
101
101
  'thread_begin' : [ None ], # begin processing
102
102
  'thread_end' : [ None ], # end processing
@@ -263,10 +263,10 @@ class LayerInterface(CtrlInterface):
263
263
  ## thread_type = Thread
264
264
  thread = None
265
265
 
266
- ## layout helper function
266
+ ## layout helper function (deprecated: internal use only)
267
267
  pack = mwx.pack
268
268
 
269
- ## funcall = interactive_call
269
+ ## funcall = interactive_call (deprecated: internal use only)
270
270
  funcall = staticmethod(_F)
271
271
 
272
272
  ## for debug (internal use only)
@@ -384,7 +384,7 @@ class LayerInterface(CtrlInterface):
384
384
  lambda v: self.parent.inspect_plug(self.__module__)),
385
385
  ]
386
386
  self.Bind(wx.EVT_CONTEXT_MENU,
387
- lambda v: mwx.Menu.Popup(self, self.menu))
387
+ lambda v: Menu.Popup(self, self.menu))
388
388
 
389
389
  self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy)
390
390
  self.Bind(wx.EVT_SHOW, self.OnShow)
@@ -699,14 +699,15 @@ class Frame(mwx.Frame):
699
699
  lambda v: self.save_buffers_as_tiffs(),
700
700
  lambda v: v.Enable(self.__view.frame is not None)),
701
701
  (),
702
- ## ("Index", (
703
- ## (mwx.ID_(11), "&Import index\tCtrl+Shift+o", "Import index file", Icon('open'),
704
- ## lambda v: self.load_index()),
705
- ##
706
- ## (mwx.ID_(12), "&Export index\tCtrl+Shift+s", "Export index file", Icon('saveas'),
707
- ## lambda v: self.save_index(),
708
- ## lambda v: v.Enable(self.__view.frame is not None)),
709
- ## )),
702
+ ("Index", (
703
+ (mwx.ID_(11), "&Import index\tCtrl+Shift+o", "Import index file", Icon('open'),
704
+ lambda v: self.load_index()),
705
+
706
+ (mwx.ID_(12), "&Export index\tCtrl+Shift+s", "Export index file", Icon('saveas'),
707
+ lambda v: self.save_index(),
708
+ lambda v: v.Enable(self.__view.frame is not None)),
709
+ )),
710
+ (),
710
711
  ("Session", (
711
712
  (mwx.ID_(15), "&Open session", "Open session file",
712
713
  lambda v: self.load_session()),
@@ -1380,7 +1381,8 @@ class Frame(mwx.Frame):
1380
1381
  plug = _plug
1381
1382
  init(shell)
1382
1383
  self.shellframe.Show()
1383
- self.shellframe.load(plug)
1384
+ if wx.GetKeyState(wx.WXK_SHIFT):
1385
+ self.shellframe.load(plug)
1384
1386
 
1385
1387
  def OnLoadPlugins(self, evt):
1386
1388
  with wx.FileDialog(self, "Load a plugin file",
mwx/matplot2.py CHANGED
@@ -12,6 +12,7 @@ from matplotlib import cm
12
12
  import numpy as np
13
13
 
14
14
  from . import framework as mwx
15
+ from .framework import hotkey, regulate_key, pack, Menu, FSM
15
16
 
16
17
 
17
18
  ## state constants
@@ -111,7 +112,7 @@ class MatplotPanel(wx.Panel):
111
112
  self.infobar.Size = (0, 0) # workaround for incorrect wrap sizing
112
113
 
113
114
  self.SetSizer(
114
- mwx.pack(self, (
115
+ pack(self, (
115
116
  (self.canvas, 1, wx.EXPAND | wx.ALL, 0),
116
117
  (self.infobar, 0, wx.EXPAND | wx.ALL, 0),
117
118
  (self.modeline, 0, wx.EXPAND | wx.ALL, 2),
@@ -162,7 +163,7 @@ class MatplotPanel(wx.Panel):
162
163
  if self.handler.fork(self.handler.current_event, evt) is None:
163
164
  evt.Skip()
164
165
 
165
- self.__handler = mwx.FSM({ # DNA<MatplotPanel>
166
+ self.__handler = FSM({ # DNA<MatplotPanel>
166
167
  None : {
167
168
  'canvas_draw' : [ None, self.OnDraw ], # before canvas.draw
168
169
  #'canvas_drawn' : [ None, ], # after canvas.draw
@@ -397,6 +398,7 @@ class MatplotPanel(wx.Panel):
397
398
  self.modeline.SetBackgroundColour(self.selectedModeLineBg)
398
399
  self.modeline.SetForegroundColour(self.selectedModeLineFg)
399
400
  self.modeline.Refresh()
401
+ self.escape()
400
402
  evt.Skip()
401
403
 
402
404
  def on_focus_kill(self, evt): #<wx._core.FocusEvent>
@@ -404,6 +406,7 @@ class MatplotPanel(wx.Panel):
404
406
  self.modeline.SetBackgroundColour(self.unselectedModeLineBg)
405
407
  self.modeline.SetForegroundColour(self.unselectedModeLineFg)
406
408
  self.modeline.Refresh()
409
+ self.escape()
407
410
  evt.Skip()
408
411
 
409
412
  def escape(self, evt=None):
@@ -491,7 +494,7 @@ class MatplotPanel(wx.Panel):
491
494
  def on_menu(self, evt): #<matplotlib.backend_bases.MouseEvent>
492
495
  if self.__isMenu:
493
496
  self.canvas.SetFocus()
494
- mwx.Menu.Popup(self, self.menu)
497
+ Menu.Popup(self, self.menu)
495
498
  self.__isMenu = 0
496
499
 
497
500
  def on_pick(self, evt): #<matplotlib.backend_bases.PickEvent>
@@ -527,8 +530,8 @@ class MatplotPanel(wx.Panel):
527
530
 
528
531
  def on_hotkey_press(self, evt): #<wx._core.KeyEvent>
529
532
  """Called when a key is pressed."""
530
- key = mwx.hotkey(evt)
531
- self.__key = mwx.regulate_key(key + '+')
533
+ key = hotkey(evt)
534
+ self.__key = regulate_key(key + '+')
532
535
  if self.handler('{} pressed'.format(key), evt) is None:
533
536
  evt.Skip()
534
537
 
@@ -543,7 +546,7 @@ class MatplotPanel(wx.Panel):
543
546
 
544
547
  def on_hotkey_release(self, evt): #<wx._core.KeyEvent>
545
548
  """Called when a key is released."""
546
- key = mwx.hotkey(evt)
549
+ key = hotkey(evt)
547
550
  self.__key = ''
548
551
  if self.handler('{} released'.format(key), evt) is None:
549
552
  evt.Skip()
mwx/matplot2g.py CHANGED
@@ -14,6 +14,7 @@ from numpy import pi, nan
14
14
  from scipy import ndimage as ndi
15
15
 
16
16
  from . import framework as mwx
17
+ from .framework import Menu
17
18
  from .utilus import funcall as _F
18
19
  from .controls import Clipboard
19
20
  from .matplot2 import MatplotPanel
@@ -583,7 +584,7 @@ class GraphPlot(MatplotPanel):
583
584
  lambda v: v.Check(self.frame is not None and self.frame.name == s))
584
585
 
585
586
  self.modeline.Bind(wx.EVT_CONTEXT_MENU, lambda v:
586
- mwx.Menu.Popup(self,
587
+ Menu.Popup(self,
587
588
  (_menu(j, art.name) for j, art in enumerate(self.__Arts))))
588
589
 
589
590
  self.modeline.Show(1)
@@ -106,8 +106,8 @@ class Plugin(Layer):
106
106
  updater=self.get_crop,
107
107
  )
108
108
 
109
- self.snp = Button(self, handler=self.snapshot, tip='Snapshot', icon='clock')
110
- self.exp = Button(self, handler=self.export, tip="Export", icon='save')
109
+ self.snp = Button(self, handler=self.snapshot, icon='clock')
110
+ self.exp = Button(self, handler=self.export, icon='save')
111
111
 
112
112
  self.rw = Button(self, handler=lambda v: self.seekdelta(-100), icon='|<-')
113
113
  self.fw = Button(self, handler=lambda v: self.seekdelta(+100), icon='->|')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mwxlib
3
- Version: 0.95.9
3
+ Version: 0.96.0
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
1
  mwx/__init__.py,sha256=nN62CGTWjME7Zz2h-jIRB8MxwuErIkHPGrlBzydkF0o,643
2
2
  mwx/bookshelf.py,sha256=DAhMQk3_J4rdE50adBMFu5wNz3WdMh_zzJ37O9ncceo,5103
3
3
  mwx/controls.py,sha256=IAT3l3-azlPFtMc2VGNMiQhI390ExW0S4CgjEOKFI4s,48200
4
- mwx/framework.py,sha256=OVFv_5c-vrXRuvWm9YN8cHWmvN-svodmMAnlOAPBwQ4,75669
5
- mwx/graphman.py,sha256=NBe58KdAstFNPqyEmpPMMmWwjtNgJB7HumSI7-gjw54,70533
4
+ mwx/framework.py,sha256=Z-WbpepmraX_7wCq4jWpOCeDhUrUO5NlOmFLf2RjoLk,75666
5
+ mwx/graphman.py,sha256=4SRwCMs4-sS3n23FthythhuG9dBJ8TLz_TVyoYAbdoA,70639
6
6
  mwx/images.py,sha256=gyvqW4TLWdJMKmsaWiPiV_PuHJM1GbHgeELERLwGzg8,45291
7
- mwx/matplot2.py,sha256=1ISXVwqlu1EJKe5JXmBC2tuecsRoFzJrMZsqQMxdC50,33432
8
- mwx/matplot2g.py,sha256=KIuownEsF7t2RgHn3kOxjBXbKOdfS99X_CtQweG_FrM,65471
7
+ mwx/matplot2.py,sha256=-G7z0Osozm9NjLfXvX5UcdFviwbNUktjbd904_g-PqQ,33516
8
+ mwx/matplot2g.py,sha256=Ii0y4Ebod-9EJ-WPaCyZ-voM5uC3MTDmNktJD7OiTtA,65496
9
9
  mwx/matplot2lg.py,sha256=pcu1oDPE_BlpFqNGPPKf9vpTuDs_h_u3OTRAJx5-Sds,27392
10
10
  mwx/mgplt.py,sha256=ITzxA97yDwr_35BUk5OqnyskSuKVDbpf2AQCKY1jHTI,5671
11
11
  mwx/nutshell.py,sha256=pbsQATwt906lOXGFWJmuwZIwU_ve78o46I2g5zNjvG4,137050
@@ -15,14 +15,14 @@ mwx/wxpdb.py,sha256=lLowkkAgMhPFHAfklD7wZHq0qbSMjRxnBFtSajmVgME,19133
15
15
  mwx/wxwil.py,sha256=zP1-5Fpi1wpDQU977229zIH6QRuSkkyfuAlNKWjGoGg,5588
16
16
  mwx/wxwit.py,sha256=yU6XeCCWRBP7CLmpphjT072PfXAL30DNaxoChDX2p0I,7322
17
17
  mwx/plugins/__init__.py,sha256=jnJ-Sl9XJ_7BFDslD_r7dsbxsOT57q_IaEriV53XIGY,41
18
- mwx/plugins/ffmpeg_view.py,sha256=vUYNybIJsF1JGkDzjBgDyBQvDh8e1oKHlEMY5Fwc8L4,9399
18
+ mwx/plugins/ffmpeg_view.py,sha256=wZXRgsiPyIphcA8hvXQoE7NZp4cc_YBOO0ZpuKmUJKE,9369
19
19
  mwx/plugins/fft_view.py,sha256=HcnBr-y_yFdSfASPRzMLANta4SwSDShd65QWnCU3XhM,2665
20
20
  mwx/plugins/frame_listview.py,sha256=RaYOj-YKrpLqhT8TkBRDX1TQnSPv90V185j8OjrWJTs,10108
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.9.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
- mwxlib-0.95.9.dist-info/METADATA,sha256=TpQuGm-jesDFI2I-g8nwPcIqT7Edpv4_pM1ZFBb3gwo,1925
26
- mwxlib-0.95.9.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
27
- mwxlib-0.95.9.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
- mwxlib-0.95.9.dist-info/RECORD,,
24
+ mwxlib-0.96.0.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
+ mwxlib-0.96.0.dist-info/METADATA,sha256=3UowIlnhpmH3yDgustsBu7iviC9fFKYIWtspEFsWYNs,1925
26
+ mwxlib-0.96.0.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
27
+ mwxlib-0.96.0.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
+ mwxlib-0.96.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (70.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5