mwxlib 0.84.7__py3-none-any.whl → 0.84.9__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
@@ -4,7 +4,7 @@
4
4
 
5
5
  Author: Kazuya O'moto <komoto@jeol.co.jp>
6
6
  """
7
- __version__ = "0.84.7"
7
+ __version__ = "0.84.9"
8
8
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
9
9
 
10
10
  from functools import wraps, partial
mwx/graphman.py CHANGED
@@ -201,6 +201,7 @@ class LayerInterface(CtrlInterface):
201
201
 
202
202
  Note:
203
203
  parent <Frame> is not always equal to Parent when floating.
204
+ Parent type can be <Frame>, <AuiFloatingFrame>, or <AuiNotebook>.
204
205
  """
205
206
  MENU = "Plugins" # default menu for Plugins
206
207
  menukey = property(lambda self: "{}/&{}".format(self.MENU, self.__module__))
@@ -350,11 +351,10 @@ class LayerInterface(CtrlInterface):
350
351
  self.Bind(wx.EVT_WINDOW_DESTROY, destroy)
351
352
 
352
353
  def on_show(v):
353
- if self and isinstance(self.Parent, aui.AuiNotebook):
354
- if v.IsShown():
355
- self.handler('page_shown', self)
356
- else:
357
- self.handler('page_hidden', self)
354
+ if v.IsShown():
355
+ self.handler('page_shown', self)
356
+ elif self and isinstance(self.Parent, aui.AuiNotebook):
357
+ self.handler('page_hidden', self) # -> notebook
358
358
  v.Skip()
359
359
  self.Bind(wx.EVT_SHOW, on_show)
360
360
 
@@ -850,8 +850,8 @@ class Frame(mwx.Frame):
850
850
 
851
851
  ## Force Layer windows to show.
852
852
  if interactive:
853
- ## [M-menu] Reload plugin (ret: None if succeeded).
854
- if wx.GetKeyState(wx.WXK_ALT):
853
+ ## [M-S-menu] Reload plugin
854
+ if wx.GetKeyState(wx.WXK_ALT) and wx.GetKeyState(wx.WXK_SHIFT):
855
855
  self.reload_plug(name)
856
856
  pane = self.get_pane(name)
857
857
  show = True
@@ -862,14 +862,18 @@ class Frame(mwx.Frame):
862
862
  pane.Float()
863
863
  show = True
864
864
 
865
- plug = self.get_plug(name) # -> None if pane.window is Graph
865
+ plug = self.get_plug(name) # -> None if pane.window is a Graph
866
866
  win = pane.window # -> Window (plug / notebook / Graph)
867
867
  if show:
868
868
  if isinstance(win, aui.AuiNotebook):
869
- win.SetSelection(win.GetPageIndex(plug)) # => [page_shown]
870
-
869
+ j = win.GetPageIndex(plug)
870
+ if j != win.Selection:
871
+ win.Selection = j # the focus is moved => [page_shown]
872
+ else:
873
+ plug.handler('page_shown', plug)
871
874
  elif not pane.IsShown():
872
- win.handler('page_shown', win)
875
+ if not plug or win.Parent is not self: # otherwise Layer.on_show
876
+ win.handler('page_shown', win)
873
877
  else:
874
878
  if isinstance(win, aui.AuiNotebook):
875
879
  for plug in win.all_pages: # => [page_closed] to all pages
@@ -1181,13 +1185,14 @@ class Frame(mwx.Frame):
1181
1185
  .Name(name).Caption(caption)
1182
1186
  .FloatingSize(size).MinSize(size).Show(0))
1183
1187
 
1184
- ## set reference of notebook (optional)
1185
- plug.__notebook = nb
1186
- plug.__Menu_item = None
1188
+ ## Set winow.Name for inspection.
1187
1189
  plug.Name = name
1190
+
1188
1191
  self.update_pane(name, **props)
1189
1192
 
1190
1193
  ## Create a menu
1194
+ plug.__Menu_item = None
1195
+
1191
1196
  if not hasattr(module, 'ID_'): # give a unique index to the module
1192
1197
  global __plug_ID__ # cache ID *not* in [ID_LOWEST(4999):ID_HIGHEST(5999)]
1193
1198
  try:
@@ -1232,12 +1237,13 @@ class Frame(mwx.Frame):
1232
1237
  self.menubar[menu].remove(plug.__Menu_item)
1233
1238
  self.menubar.update(menu)
1234
1239
 
1235
- nb = plug.__notebook
1236
- if nb:
1240
+ if isinstance(plug.Parent, aui.AuiNotebook):
1241
+ nb = plug.Parent
1237
1242
  j = nb.GetPageIndex(plug)
1238
1243
  nb.RemovePage(j) # just remove page
1239
1244
  ## nb.DeletePage(j) # cf. destroy plug object too
1240
1245
  else:
1246
+ nb = None
1241
1247
  self._mgr.DetachPane(plug)
1242
1248
  self._mgr.Update()
1243
1249
 
@@ -1264,6 +1270,7 @@ class Frame(mwx.Frame):
1264
1270
  if plug.reloadable:
1265
1271
  session = {}
1266
1272
  try:
1273
+ print("Reloading {}...".format(plug))
1267
1274
  plug.save_session(session)
1268
1275
  except Exception:
1269
1276
  traceback.print_exc()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mwxlib
3
- Version: 0.84.7
3
+ Version: 0.84.9
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 <komoto@jeol.co.jp>
@@ -1,7 +1,7 @@
1
1
  mwx/__init__.py,sha256=bSRdncjfSCKycMFQVnagOi9R2vUCC5snGkjea7jqPgU,2520
2
2
  mwx/controls.py,sha256=pD1IjgkwdvD-ebntnAH-6Jo7KY5hDq30Ne6rTE_i9fE,43499
3
- mwx/framework.py,sha256=x8a-rEsIoGwycAMhPM3G9UcTCXYUOixVrq_BhmyHg5M,73816
4
- mwx/graphman.py,sha256=H4501ZK0YMX52woEJHg7NlEvE-iuF7CKvgV3XzTgpLQ,68312
3
+ mwx/framework.py,sha256=axKlqwJG6pi5x6q0-dUtegNtDzBDWqow9QGasGt3vXM,73816
4
+ mwx/graphman.py,sha256=iF1cSVYdQHiu1Wylt1cBGIzbQtZQLSetRN3qw_g6-jA,68716
5
5
  mwx/images.py,sha256=9e8X7OpJ6Z3fF3ez17P_qk2D1NMO10-lN8TCtulAqT0,46248
6
6
  mwx/matplot2.py,sha256=W_FpY0S33crCAh7N9YTXo-jgYzj8uL9gqXkekfQo7Pk,36017
7
7
  mwx/matplot2g.py,sha256=cBuLMnQt3XSKQL9io0XJb_v8Lv0pO9hm0IMjVIERtu4,68253
@@ -15,8 +15,8 @@ mwx/wxwil.py,sha256=DPXXx4OdEzvHr-_jxz9J29Ozufmb6Vr7rXVkG_LKQd0,5254
15
15
  mwx/wxwit.py,sha256=UG361QTUheO_hlSIRgkprrGUYh0IzHB8ZqOoJeeMzUs,7424
16
16
  mwx/py/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  mwx/py/filling.py,sha256=f6KMBcBv7gwrl6qmJYLTL-O0Z47bWNAdTCZtUZIo8vM,16794
18
- mwxlib-0.84.7.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
19
- mwxlib-0.84.7.dist-info/METADATA,sha256=S4H6IiZhEuzEV4oMaMhMBMDuEj3tM1LgEhf3QHKFimo,1893
20
- mwxlib-0.84.7.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
21
- mwxlib-0.84.7.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
22
- mwxlib-0.84.7.dist-info/RECORD,,
18
+ mwxlib-0.84.9.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
19
+ mwxlib-0.84.9.dist-info/METADATA,sha256=Nt7X4C4jS8_safBBRGm2ZcZzk3WEo5B9-czJj-3UIfU,1893
20
+ mwxlib-0.84.9.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
21
+ mwxlib-0.84.9.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
22
+ mwxlib-0.84.9.dist-info/RECORD,,