mwxlib 1.6.7__py3-none-any.whl → 1.6.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.6.7"
4
+ __version__ = "1.6.10"
5
5
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
6
6
 
7
7
  from contextlib import contextmanager
@@ -610,16 +610,14 @@ class Menu(wx.Menu):
610
610
  item.SubMenu._unbind()
611
611
 
612
612
  def Destroy(self):
613
- try:
613
+ if self.owner and not self.owner.IsBeingDeleted():
614
614
  self._unbind()
615
- except Exception:
616
- pass
617
615
  return wx.Menu.Destroy(self)
618
616
 
619
617
  @staticmethod
620
- def Popup(parent, menulist, *args, **kwargs):
621
- menu = Menu(parent, menulist)
622
- parent.PopupMenu(menu, *args, **kwargs)
618
+ def Popup(owner, menulist, *args, **kwargs):
619
+ menu = Menu(owner, menulist)
620
+ owner.PopupMenu(menu, *args, **kwargs)
623
621
  menu.Destroy()
624
622
 
625
623
 
@@ -838,9 +836,6 @@ class MiniFrame(wx.MiniFrame, KeyCtrlInterfaceMixin):
838
836
  },
839
837
  )
840
838
  self.make_keymap('C-x')
841
-
842
- def Destroy(self):
843
- return wx.MiniFrame.Destroy(self)
844
839
 
845
840
 
846
841
  class AuiNotebook(aui.AuiNotebook):
mwx/graphman.py CHANGED
@@ -88,8 +88,6 @@ class Thread:
88
88
  None : {
89
89
  'thread_begin' : [ None ],
90
90
  'thread_end' : [ None ],
91
- 'thread_quit' : [ None ],
92
- 'thread_error' : [ None ],
93
91
  },
94
92
  })
95
93
 
@@ -183,7 +181,6 @@ class Thread:
183
181
  pass
184
182
  except KeyboardInterrupt as e:
185
183
  print("- Thread terminated by user:", e)
186
- wx.CallAfter(self.handler, 'thread_quit', self)
187
184
  except Exception as e:
188
185
  print("- Thread failed in error:", e)
189
186
  traceback.print_exc()
@@ -192,7 +189,6 @@ class Thread:
192
189
  f"{e}\n\n" + tbstr[-1] + f"{type(e).__name__}: {e}",
193
190
  f"Error in the thread running {f.__name__!r}\n\n",
194
191
  style=wx.ICON_ERROR)
195
- wx.CallAfter(self.handler, 'thread_error', self)
196
192
  finally:
197
193
  self.active = 0
198
194
  wx.CallAfter(self.handler, 'thread_end', self)
@@ -1085,8 +1081,6 @@ class Frame(mwx.Frame):
1085
1081
  name = root.__module__
1086
1082
  else:
1087
1083
  name = root
1088
- if name == "__main__":
1089
- name = inspect.getfile(__import__("__main__"))
1090
1084
 
1091
1085
  dirname_, name = os.path.split(name) # if the name is full-path:str
1092
1086
  if name.endswith(".py"):
@@ -1121,11 +1115,11 @@ class Frame(mwx.Frame):
1121
1115
 
1122
1116
  ## Load or reload the module, and check whether it contains a class named `Plugin`.
1123
1117
  try:
1124
- loadable = (not name.startswith("__main__")) # Check if the module is loadable.
1118
+ ## Check if the module is reloadable.
1119
+ loadable = not name.startswith(("__main__", "builtins")) # no __file__
1125
1120
  if not loadable:
1126
1121
  module = types.ModuleType(name) # dummy module (cannot reload)
1127
1122
  module.__file__ = "<scratch>"
1128
- ## sys.modules[name] = module
1129
1123
  elif name in sys.modules:
1130
1124
  module = reload(sys.modules[name])
1131
1125
  else:
@@ -1256,6 +1250,8 @@ class Frame(mwx.Frame):
1256
1250
  self.menubar[menu] = []
1257
1251
  self.menubar[menu] += [plug.__Menu_item]
1258
1252
  self.menubar.update(menu)
1253
+
1254
+ self.handler('plug_loaded', plug)
1259
1255
  return None
1260
1256
 
1261
1257
  def unload_plug(self, name):
@@ -1283,6 +1279,7 @@ class Frame(mwx.Frame):
1283
1279
  self._mgr.DetachPane(plug)
1284
1280
  self._mgr.Update()
1285
1281
 
1282
+ self.handler('plug_unloaded', plug)
1286
1283
  plug.handler('page_closed', plug) # (even if not shown)
1287
1284
  plug.Destroy()
1288
1285
 
mwx/nutshell.py CHANGED
@@ -2817,7 +2817,7 @@ class Nautilus(EditorInterface, Shell):
2817
2817
  obj.self = obj
2818
2818
  obj.this = inspect.getmodule(obj)
2819
2819
  obj.shell = self # Overwrite the facade <wx.py.shell.ShellFacade>.
2820
- obj.__name__ = typename(obj) # A namespace for ghost in the shell. cf. exec_region
2820
+ ## obj.__name__ = typename(obj) # A namespace for ghost in the shell. cf. exec_region
2821
2821
  except AttributeError:
2822
2822
  pass
2823
2823
  self.parent.handler('title_window', obj)
mwx/wxpdb.py CHANGED
@@ -449,7 +449,7 @@ class Debugger(Pdb):
449
449
  try:
450
450
  Pdb.set_quit(self)
451
451
  finally:
452
- if self.parent: # Check if Destroy has begun.
452
+ if self.parent: # Check if the parent is being deleted.
453
453
  self.handler('debug_end', self.curframe)
454
454
 
455
455
  ## --------------------------------
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mwxlib
3
- Version: 1.6.7
3
+ Version: 1.6.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,18 +1,18 @@
1
1
  mwx/__init__.py,sha256=pS7ZG8QKRypiFFiaWAq_opBB6I_1viZ0zUMk2TbjzE0,667
2
2
  mwx/bookshelf.py,sha256=b3LhF0TXFRhbbjg3HUzq4qTk4BLzF713a3Tbh3_0iVI,8455
3
3
  mwx/controls.py,sha256=N_4TAEMGNBD3AiVzm4JZ6SDH8VJ2gFsRPFYF40T6yL0,50006
4
- mwx/framework.py,sha256=N9gTB2Uyi6FvgTVEYi7KLtHifzHajf3nYBK_b_SdQL4,77596
5
- mwx/graphman.py,sha256=7R-vNzu0VJ_u4eT6-7Sel_qA8BZoSfG7p7zbaf-uetA,70591
4
+ mwx/framework.py,sha256=IqDqMB-1PlcjTtsn52XT0Iun7G8t3MKTE3UZrQ7j110,77522
5
+ mwx/graphman.py,sha256=GEIIvpiC9H4bGDhIWFb-J4hOgch8wXvx1-Mr4nGp9zs,70371
6
6
  mwx/images.py,sha256=Kkfy9QI_hMtwShSjUS4-ZpC_EkVuah_XhpBOR4wAKkM,49792
7
7
  mwx/matplot2.py,sha256=HrURlLP-jEubuHrOhL1yvXOgeduHn1OqYnT2bWg4BoM,32995
8
8
  mwx/matplot2g.py,sha256=BzftcjoVx_sFw57osb31jsnIAwJQC8CqexCUC0AY9ZU,66533
9
9
  mwx/matplot2lg.py,sha256=91ItF-6_zc_tQGvjMgtgc1UKdI_yhe8dDCzj1nN5TQc,27411
10
10
  mwx/mgplt.py,sha256=SVUJ0ls4gC9xulbWxK2qqmDxf0uBCflvwoPkxoF5s3M,5566
11
- mwx/nutshell.py,sha256=-2QHKIDHEdJhCjcHmhyKBKTYQdydK6m0ssqp597Oe3Q,147505
11
+ mwx/nutshell.py,sha256=53gi361x_ATsC8_oEtxxeZXXurpUxPGGMZRy1YV7SVw,147508
12
12
  mwx/testsuite.py,sha256=pBB7ZNicI_thrg6LmNPgUOgfMWwRoAaYWN1nFy6t6S4,790
13
13
  mwx/utilus.py,sha256=JOYBTHoo_GmYykX72PgiPzgD2M-1pcOR8gMBLc2bnck,39016
14
14
  mwx/wxmon.py,sha256=aS6lSjDm0PxIhfyBPtg-wIP0v-R3g2K5a3k2mclWSrQ,12798
15
- mwx/wxpdb.py,sha256=ehRawAnqQberUeDN9j_-drWYQzu23w5UeQyto4nj53g,18812
15
+ mwx/wxpdb.py,sha256=yfpsbYvWVYG0Zubt_dsYcyuNxgkqARUHviMMvSQyjrk,18822
16
16
  mwx/wxwil.py,sha256=_74m3jEUu3ktjHKHWEEK34ck439u9A0PhDDxFVTA0_Y,5404
17
17
  mwx/wxwit.py,sha256=W7wP9loxw0dAdk5-NWMIHt19Og1h-3vFzz-8BPicHB4,7348
18
18
  mwx/plugins/__init__.py,sha256=jnJ-Sl9XJ_7BFDslD_r7dsbxsOT57q_IaEriV53XIGY,41
@@ -22,7 +22,7 @@ mwx/plugins/frame_listview.py,sha256=yd2NCgspqGfTNhj1wxuW8r1zapIm7vNzVX2iytk8CDM
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=vWCJoHd_oyXOeXTHtXGY7wfNQeNAZhV3GZu4xlc8GDY,16867
25
- mwxlib-1.6.7.dist-info/METADATA,sha256=JPmghjPapW6r7Yfk1-naUsmJBlU88iLXxPHe6-ahkpU,7381
26
- mwxlib-1.6.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
- mwxlib-1.6.7.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
- mwxlib-1.6.7.dist-info/RECORD,,
25
+ mwxlib-1.6.10.dist-info/METADATA,sha256=YEPsg7BMMTCCfe9pulkuXFWdOMyHm5MXm1bTgaOpQ3I,7382
26
+ mwxlib-1.6.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
+ mwxlib-1.6.10.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
+ mwxlib-1.6.10.dist-info/RECORD,,