mwxlib 1.5.9__py3-none-any.whl → 1.5.10__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__ = "1.5.9"
4
+ __version__ = "1.5.10"
5
5
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
6
6
 
7
7
  from contextlib import contextmanager
mwx/graphman.py CHANGED
@@ -377,12 +377,12 @@ class LayerInterface(CtrlInterface):
377
377
  lambda v: reset_params(v, checked_only=wx.GetKeyState(wx.WXK_SHIFT)),
378
378
  lambda v: v.Enable(bool(self.parameters))),
379
379
  (),
380
- (mwx.ID_(201), "&Reload module", "Reload module", Icon('load'),
380
+ (mwx.ID_(201), "&Reload {!r}".format(self.__module__), "Reload", Icon('load'),
381
381
  lambda v: self.parent.reload_plug(self.__module__),
382
382
  lambda v: v.Enable(self.reloadable
383
383
  and not (self.thread and self.thread.active))),
384
384
 
385
- (mwx.ID_(202), "&Unload module", "Unload module", Icon('delete'),
385
+ (mwx.ID_(202), "&Unload {!r}".format(self.__module__), "Unload", Icon('delete'),
386
386
  lambda v: self.parent.unload_plug(self.__module__),
387
387
  lambda v: v.Enable(self.unloadable
388
388
  and not (self.thread and self.thread.active))),
@@ -1713,7 +1713,7 @@ class Frame(mwx.Frame):
1713
1713
  filename = dlg.Path
1714
1714
 
1715
1715
  if flush:
1716
- for name in list(self.plugins): # plugins:dict mutates during iteration
1716
+ for name in list(self.plugins): # plugins:dict mutates during iteration
1717
1717
  self.unload_plug(name)
1718
1718
  del self.graph[:]
1719
1719
  del self.output[:]
@@ -1767,24 +1767,25 @@ class Frame(mwx.Frame):
1767
1767
  self.message("Saving session to {!r}...".format(self.session_file))
1768
1768
 
1769
1769
  with open(self.session_file, 'w') as o,\
1770
- np.printoptions(threshold=np.inf): # printing all(inf) elements
1770
+ np.printoptions(threshold=np.inf): # printing all(inf) elements
1771
1771
  o.write("#! Session file (This file is generated automatically)\n")
1772
1772
  o.write("self.SetSize({})\n".format(self.Size))
1773
1773
  o.write("self.SetPosition({})\n".format(self.Position))
1774
1774
 
1775
1775
  for name, module in self.plugins.items():
1776
1776
  plug = self.get_plug(name)
1777
- path = os.path.abspath(module.__file__)
1778
- basename = os.path.basename(path)
1779
- if basename == "__init__.py": # is module package?
1780
- path = path[:-12]
1777
+ if '.' not in name:
1778
+ name = os.path.abspath(module.__file__) # Replace name with full path.
1779
+ basename = os.path.basename(name)
1780
+ if basename == "__init__.py": # is module package?
1781
+ name = name[:-12]
1781
1782
  session = {}
1782
1783
  try:
1783
1784
  plug.save_session(session)
1784
1785
  except Exception:
1785
1786
  traceback.print_exc()
1786
1787
  print("- Failed to save session of", plug)
1787
- o.write("self.load_plug({!r}, session={})\n".format(path, session or None))
1788
+ o.write("self.load_plug({!r}, session={})\n".format(name, session or None))
1788
1789
  o.write("self._mgr.LoadPerspective({!r})\n".format(self._mgr.SavePerspective()))
1789
1790
 
1790
1791
  def _save(view):
@@ -75,6 +75,10 @@ class CheckList(wx.ListCtrl, ListCtrlAutoWidthMixin, CtrlInterface):
75
75
  'C-a pressed' : (0, self.OnSelectAllItems),
76
76
  'C-o pressed' : (0, self.OnLoadItems),
77
77
  'C-s pressed' : (0, self.OnSaveItems),
78
+ 'C-S-s pressed' : (0, self.OnSaveItems),
79
+ 'C-c pressed' : (0, self.OnCopyInfo),
80
+ 'C-l pressed' : (0, self.OnEditLocalUnit),
81
+ 'f2 pressed' : (0, self.OnEditAnnotation),
78
82
  'M-up pressed' : (0, self.Target.OnPageUp),
79
83
  'M-down pressed' : (0, self.Target.OnPageDown),
80
84
  },
@@ -98,7 +102,7 @@ class CheckList(wx.ListCtrl, ListCtrlAutoWidthMixin, CtrlInterface):
98
102
 
99
103
  self.menu = [
100
104
  (100, "Edit localunit", Icon('image'),
101
- self.OnEditUnit,
105
+ self.OnEditLocalUnit,
102
106
  lambda v: v.Enable(self.focused_item != -1)),
103
107
 
104
108
  (101, "Edit annotation", Icon('pencil'),
@@ -181,20 +185,20 @@ class CheckList(wx.ListCtrl, ListCtrlAutoWidthMixin, CtrlInterface):
181
185
  def OnCopyInfo(self, evt):
182
186
  selected_frames = [self.Target.all_frames[j] for j in self.selected_items]
183
187
  if selected_frames:
184
- text = ''
188
+ text = []
185
189
  for frame in selected_frames:
186
- text += pformat(frame.attributes, sort_dicts=0) # ALL attributes
187
- ## text += '{}\n{}\n'.format(frame.name, frame.annotation)
188
- Clipboard.write(text)
190
+ text += [pformat(frame.attributes, sort_dicts=0)] # ALL attributes
191
+ Clipboard.write('\n'.join(text))
189
192
  else:
190
193
  self.parent.message("No frame selected.")
191
194
 
192
- def OnEditUnit(self, evt):
195
+ def OnEditLocalUnit(self, evt):
193
196
  frame = self.Target.all_frames[self.focused_item]
194
197
  with wx.TextEntryDialog(self, frame.name,
195
198
  'Enter localunit', repr(frame.localunit)) as dlg:
196
199
  if dlg.ShowModal() == wx.ID_OK:
197
200
  frame.unit = eval(dlg.Value or 'None')
201
+ self.SetFocus()
198
202
 
199
203
  def OnEditAnnotation(self, evt):
200
204
  frame = self.Target.all_frames[self.focused_item]
@@ -202,6 +206,7 @@ class CheckList(wx.ListCtrl, ListCtrlAutoWidthMixin, CtrlInterface):
202
206
  'Enter an annotation', frame.annotation) as dlg:
203
207
  if dlg.ShowModal() == wx.ID_OK:
204
208
  frame.annotation = dlg.Value
209
+ self.SetFocus()
205
210
 
206
211
  def OnItemSelected(self, evt):
207
212
  frame = self.Target.all_frames[evt.Index]
mwx/utilus.py CHANGED
@@ -278,14 +278,14 @@ def pp(obj):
278
278
  pprint(obj, **pp.__dict__)
279
279
 
280
280
 
281
- if pp:
281
+ if 1:
282
282
  pp.indent = 1
283
283
  pp.width = 80 # default 80
284
284
  pp.depth = None
285
285
  if sys.version_info >= (3,6):
286
286
  pp.compact = False
287
287
  if sys.version_info >= (3,8):
288
- pp.sort_dicts = True
288
+ pp.sort_dicts = False
289
289
 
290
290
 
291
291
  def split_words(text, reverse=False):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mwxlib
3
- Version: 1.5.9
3
+ Version: 1.5.10
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,8 +1,8 @@
1
1
  mwx/__init__.py,sha256=pS7ZG8QKRypiFFiaWAq_opBB6I_1viZ0zUMk2TbjzE0,667
2
2
  mwx/bookshelf.py,sha256=yW17nMNPXKHM7LLXLpr9DaRhyFHz_OBAZ_DsuEK2QzA,8387
3
3
  mwx/controls.py,sha256=Mpzpp2eWyS_X7RjxTJay1-Fldchk-x-rUBpUhHSG-5w,49924
4
- mwx/framework.py,sha256=Bgvh2fqP5oRE79H0NFU5n_bFVLaE1c8JYHEJ8SUuqfw,77784
5
- mwx/graphman.py,sha256=zaKfcWbj6YYg2GFj_ijiqLd44OORFVKOvbQwucxNpno,69894
4
+ mwx/framework.py,sha256=hvjhA9nWgrWkpDzx1m478BD5_1OLUrSP-dfSZN463FA,77785
5
+ mwx/graphman.py,sha256=mrs4am6VbIT20gS2j9-ISHSIscZeP-eM_lLj3xYhufo,70012
6
6
  mwx/images.py,sha256=Kkfy9QI_hMtwShSjUS4-ZpC_EkVuah_XhpBOR4wAKkM,49792
7
7
  mwx/matplot2.py,sha256=5Z-m9KXtSXpzBQs3swqPbfl_mfVdDoPaWKqpiepfau8,33019
8
8
  mwx/matplot2g.py,sha256=hLBYWjXPc2jgtKPTQWCdieIegQvS4jjUUaedV4qDLoE,65255
@@ -10,7 +10,7 @@ mwx/matplot2lg.py,sha256=fpxOX18vonUTpA_nAr-wBhQ_2YNsL_nfxdCDliuP1sU,27430
10
10
  mwx/mgplt.py,sha256=SVUJ0ls4gC9xulbWxK2qqmDxf0uBCflvwoPkxoF5s3M,5566
11
11
  mwx/nutshell.py,sha256=CX-NK3kOEi3JHhjKh39R2_m1po1SvMxraaDk2xt6q-Y,147617
12
12
  mwx/testsuite.py,sha256=0Q_n_XOOsZ8lsLWUkuO8QW00hts9wEQfnUKMpf0BAyU,1235
13
- mwx/utilus.py,sha256=RiBKZLLnVqT-YrU3gFZ69eZAD25RaPARm2_fOGXG4cw,38964
13
+ mwx/utilus.py,sha256=YVU-2aR9_22-clA0OCFKfmW0c49uhNWdbQaNXxNKXxA,38964
14
14
  mwx/wxmon.py,sha256=NIksW_CZv7Kw4dod8tWVwakO4iJuvE8hJSAcjkYfLaE,12800
15
15
  mwx/wxpdb.py,sha256=kKzEGivjoZ9zGcB3ttYsAym4putyilmXZXj-5CGaivQ,18813
16
16
  mwx/wxwil.py,sha256=hhyB1lPrF9ixeObxCOKQv0Theu-B-kpJg_yVU3EGSNg,5406
@@ -18,11 +18,11 @@ mwx/wxwit.py,sha256=mTH92bWw1F3ycaq4EoxVD_4hIxy2fbKZZbQg3f1ZD1Y,7350
18
18
  mwx/plugins/__init__.py,sha256=jnJ-Sl9XJ_7BFDslD_r7dsbxsOT57q_IaEriV53XIGY,41
19
19
  mwx/plugins/ffmpeg_view.py,sha256=GT3mAP7cvAgkzHyA0Em_FP8wiWS-dRekUyBgaXIBQCc,10982
20
20
  mwx/plugins/fft_view.py,sha256=Hsho8y-42hG3htQAJ9ct1347NHJ8qPvN4snq_1jYOxw,2793
21
- mwx/plugins/frame_listview.py,sha256=q-8CrWPovgkEe4ICESfdRUDfAWJYoriElufuAcyu30U,10380
21
+ mwx/plugins/frame_listview.py,sha256=yd2NCgspqGfTNhj1wxuW8r1zapIm7vNzVX2iytk8CDM,10618
22
22
  mwx/plugins/line_profile.py,sha256=zzm6_7lnAnNepLbh07ordp3nRWDFQJtu719ZVjrVf8s,819
23
23
  mwx/py/__init__.py,sha256=xykgfOytOwNuvXsfkLoumFZSTN-iBsHOjczYXngjmUE,12
24
24
  mwx/py/filling.py,sha256=fumUG1F5M9TL-Dfqni4G85uk7TmvnUunTbdcPDV0vfo,16857
25
- mwxlib-1.5.9.dist-info/METADATA,sha256=nOrVtH-e2vPfhgGbjSkhKVVF-E1i8Z3pyP-HryhUPhs,7381
26
- mwxlib-1.5.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
- mwxlib-1.5.9.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
- mwxlib-1.5.9.dist-info/RECORD,,
25
+ mwxlib-1.5.10.dist-info/METADATA,sha256=TVRXE_-HQOVN7z-VvBMRAs1IKcYwvsPoWP-qS8Bcwh4,7382
26
+ mwxlib-1.5.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
+ mwxlib-1.5.10.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
+ mwxlib-1.5.10.dist-info/RECORD,,