mwxlib 1.4.12__py3-none-any.whl → 1.4.15__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/controls.py CHANGED
@@ -1,8 +1,9 @@
1
1
  #! python3
2
2
  """mwxlib param controller and wx custom controls.
3
3
  """
4
+ from contextlib import contextmanager
4
5
  from itertools import chain
5
- import inspect
6
+ import io
6
7
  import wx
7
8
  import wx.lib.platebtn as pb
8
9
  import wx.lib.scrolledpanel as scrolled
@@ -772,6 +773,19 @@ class Clipboard:
772
773
  This does not work unless wx.App instance exists.
773
774
  The clipboard data cannot be transferred unless wx.Frame exists.
774
775
  """
776
+ @contextmanager
777
+ @staticmethod
778
+ def istrstream():
779
+ with io.StringIO(Clipboard.read()) as f:
780
+ yield f
781
+
782
+ @contextmanager
783
+ @staticmethod
784
+ def ostrstream():
785
+ with io.StringIO() as f:
786
+ yield f
787
+ Clipboard.write(f.getvalue())
788
+
775
789
  @staticmethod
776
790
  def read(verbose=False):
777
791
  do = wx.TextDataObject()
@@ -849,7 +863,7 @@ class Clipboard:
849
863
  ## --------------------------------
850
864
 
851
865
  class Icon(wx.Bitmap):
852
- """Returns an iconic bitmap with the specified size (w, h).
866
+ """Return an iconic bitmap with the specified size (w, h).
853
867
 
854
868
  The key is either Icon.provided_arts or Icon.custom_images key.
855
869
  If the key is empty it returns a transparent bitmap, otherwise NullBitmap.
mwx/framework.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #! python3
2
2
  """mwxlib framework.
3
3
  """
4
- __version__ = "1.4.12"
4
+ __version__ = "1.4.15"
5
5
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
6
6
 
7
7
  from contextlib import contextmanager
@@ -221,7 +221,7 @@ class KeyCtrlInterfaceMixin:
221
221
 
222
222
  @staticmethod
223
223
  def getKeyState(key):
224
- """Returns state of speckey (cf. wx.GetKeyState)."""
224
+ """Return state of speckey (cf. wx.GetKeyState)."""
225
225
  try:
226
226
  return wx.GetKeyState(_speckeys_wxkmap[key])
227
227
  except KeyError:
@@ -876,12 +876,12 @@ class AuiNotebook(aui.AuiNotebook):
876
876
 
877
877
  @property
878
878
  def _all_tabs(self): # (deprecated) internal use only
879
- """Returns all AuiTabCtrl objects (internal use only)."""
879
+ """Return all AuiTabCtrl objects (internal use only)."""
880
880
  return [x for x in self.Children if isinstance(x, aui.AuiTabCtrl)]
881
881
 
882
882
  @property
883
883
  def _all_panes(self): # (deprecated) internal use only
884
- """Returns all AuiPaneInfo excluding `dummy` one (internal use only)."""
884
+ """Return all AuiPaneInfo excluding `dummy` one (internal use only)."""
885
885
  return list(self._mgr.AllPanes)[1:]
886
886
 
887
887
  def get_pages(self, type=None):
@@ -919,7 +919,7 @@ class AuiNotebook(aui.AuiNotebook):
919
919
  return True
920
920
 
921
921
  def find_tab(self, win):
922
- """Returns AuiTabCtrl and AuiNotebookPage for the window.
922
+ """Return AuiTabCtrl and AuiNotebookPage for the window.
923
923
 
924
924
  cf. aui.AuiNotebook.FindTab -> bool, tab, idx
925
925
  Note:
mwx/graphman.py CHANGED
@@ -1,9 +1,9 @@
1
1
  #! python3
2
2
  """Graph manager.
3
3
  """
4
+ from contextlib import contextmanager
4
5
  from functools import wraps
5
6
  from importlib import reload, import_module
6
- from contextlib import contextmanager
7
7
  from bdb import BdbQuit
8
8
  from pprint import pformat
9
9
  import threading
@@ -451,7 +451,7 @@ class LayerInterface(CtrlInterface):
451
451
  lambda self,v: self.Show(v))
452
452
 
453
453
  def IsShown(self):
454
- """Returns True if the window is physically visible on the screen.
454
+ """Return True if the window is physically visible on the screen.
455
455
 
456
456
  (override) Equivalent to ``IsShownOnScreen``.
457
457
  Note: The instance could be a page within a notebook.
@@ -1348,7 +1348,7 @@ class Frame(mwx.Frame):
1348
1348
  plug = _plug
1349
1349
  init(shell)
1350
1350
  self.shellframe.Show()
1351
- if wx.GetKeyState(wx.WXK_SHIFT):
1351
+ if wx.GetKeyState(wx.WXK_SHIFT): # open the source code.
1352
1352
  self.shellframe.load(plug)
1353
1353
 
1354
1354
  def OnLoadPlugins(self, evt):
@@ -1383,9 +1383,9 @@ class Frame(mwx.Frame):
1383
1383
  view = self.selected_view
1384
1384
 
1385
1385
  if not filename:
1386
- fn = view.frame.pathname if view.frame else ''
1386
+ default_path = view.frame.pathname if view.frame else None
1387
1387
  with wx.FileDialog(self, "Select index file to import",
1388
- defaultDir=os.path.dirname(fn or ''),
1388
+ defaultDir=os.path.dirname(default_path or ''),
1389
1389
  defaultFile=self.ATTRIBUTESFILE,
1390
1390
  wildcard="Index (*.index)|*.index|"
1391
1391
  "ALL files (*.*)|*.*",
@@ -1420,9 +1420,9 @@ class Frame(mwx.Frame):
1420
1420
  return None
1421
1421
 
1422
1422
  if not filename:
1423
- fn = view.frame.pathname if view.frame else ''
1423
+ default_path = view.frame.pathname if view.frame else None
1424
1424
  with wx.FileDialog(self, "Select index file to export",
1425
- defaultDir=os.path.dirname(fn or ''),
1425
+ defaultDir=os.path.dirname(default_path or ''),
1426
1426
  defaultFile=self.ATTRIBUTESFILE,
1427
1427
  wildcard="Index (*.index)|*.index",
1428
1428
  style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dlg:
@@ -1437,7 +1437,8 @@ class Frame(mwx.Frame):
1437
1437
  self.message("Export index of {!r}...".format(frame.name))
1438
1438
  fn = frame.pathname
1439
1439
  if not fn:
1440
- fn = os.path.join(savedir, frame.name) # new file
1440
+ fn = os.path.join(savedir,
1441
+ re.sub(r'[\/:*?"<>|]', '_', frame.name)) # replace invalid chars
1441
1442
  if not os.path.exists(fn):
1442
1443
  if not fn.endswith('.tif'):
1443
1444
  fn += '.tif'
@@ -1592,9 +1593,9 @@ class Frame(mwx.Frame):
1592
1593
  paths = [paths]
1593
1594
 
1594
1595
  if paths is None:
1595
- fn = view.frame.pathname if view.frame else ''
1596
+ default_path = view.frame.pathname if view.frame else None
1596
1597
  with wx.FileDialog(self, "Open image files",
1597
- defaultDir=os.path.dirname(fn or ''),
1598
+ defaultDir=os.path.dirname(default_path or ''),
1598
1599
  defaultFile='',
1599
1600
  wildcard='|'.join(self.wildcards),
1600
1601
  style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST
@@ -1649,10 +1650,10 @@ class Frame(mwx.Frame):
1649
1650
  return None
1650
1651
 
1651
1652
  if not path:
1652
- fn = view.frame.pathname if view.frame else ''
1653
+ default_path = view.frame.pathname if view.frame else None
1653
1654
  with wx.FileDialog(self, "Save buffer as",
1654
- defaultDir=os.path.dirname(fn or ''),
1655
- defaultFile=re.sub(r'[\/:*?"<>|]', '_', frame.name),
1655
+ defaultDir=os.path.dirname(default_path or ''),
1656
+ defaultFile=re.sub(r'[\/:*?"<>|]', '_', frame.name), # replace invalid chars
1656
1657
  wildcard='|'.join(self.wildcards),
1657
1658
  style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dlg:
1658
1659
  if dlg.ShowModal() != wx.ID_OK:
mwx/matplot2g.py CHANGED
@@ -636,6 +636,8 @@ class GraphPlot(MatplotPanel):
636
636
  show : Show immediately when loaded.
637
637
  **kwargs: frame attributes.
638
638
  """
639
+ assert buf is not None, "Load buffer must be an array or string (not None)"
640
+
639
641
  if isinstance(buf, str):
640
642
  buf = Image.open(buf)
641
643
 
@@ -1639,8 +1641,7 @@ class GraphPlot(MatplotPanel):
1639
1641
  color='red', size=7, #fontsize=8,
1640
1642
  )
1641
1643
  )
1642
- self.selector = self.get_current_mark()
1643
- self.trace_point(*self.selector, type=MARK)
1644
+ self.trace_point(*self.get_current_mark(), type=MARK)
1644
1645
  self.draw(self.marked)
1645
1646
 
1646
1647
  def OnMarkAppend(self, evt):
@@ -1663,7 +1664,7 @@ class GraphPlot(MatplotPanel):
1663
1664
  else:
1664
1665
  self.__marksel = [k]
1665
1666
  self.update_art_of_mark()
1666
-
1667
+ self.selector = self.get_current_mark()
1667
1668
  if self.selector.shape[1] > 1:
1668
1669
  self.handler('line_drawn', self.frame) # 多重マーカー選択時
1669
1670
 
mwx/nutshell.py CHANGED
@@ -1,9 +1,9 @@
1
1
  #! python3
2
2
  """mwxlib Nautilus in the shell.
3
3
  """
4
+ from contextlib import contextmanager
4
5
  from functools import wraps
5
6
  from importlib import import_module
6
- from contextlib import contextmanager
7
7
  from pathlib import Path
8
8
  from pprint import pformat
9
9
  from bdb import BdbQuit
@@ -288,9 +288,17 @@ class AutoCompInterfaceMixin:
288
288
 
289
289
  def _get_words_hint(self):
290
290
  cmdl = self.GetTextRange(self.bol, self.cpos)
291
- text = next(split_words(cmdl, reverse=1), '')
291
+ if cmdl.endswith(' '): # 前の文字が空白の場合はスキップする
292
+ text = ''
293
+ else:
294
+ text = next(split_words(cmdl, reverse=1), '')
292
295
  return text.rpartition('.') # -> text, sep, hint
293
296
 
297
+ def clear_autocomp(self, evt):
298
+ if self.AutoCompActive():
299
+ self.AutoCompCancel()
300
+ self.message("")
301
+
294
302
  def call_history_comp(self, evt):
295
303
  """Called when history-comp mode."""
296
304
  if not self.CanEdit():
@@ -345,8 +353,9 @@ class AutoCompInterfaceMixin:
345
353
  return lh
346
354
 
347
355
  cmdl = self.GetTextRange(self.bol, self.cpos)
348
- hint = re.search(r"[\w.]*$", cmdl).group(0) # extract the last word
356
+ hint = re.search(r"[\w.]*$", cmdl).group(0) # extract the last word including dots
349
357
  try:
358
+ ## from * import ...
350
359
  if (m := re.match(r"from\s+([\w.]+)\s+import\s+(.*)", cmdl)):
351
360
  text, hints = m.groups()
352
361
  if not _continue(hints) and not force:
@@ -366,13 +375,14 @@ class AutoCompInterfaceMixin:
366
375
  q = f"{text}.{hint}".lower()
367
376
  keys = [x[len(text)+1:] for x in self.modules if x.lower().startswith(q)]
368
377
  modules.update(k for k in keys if '.' not in k)
369
-
378
+ ## import ...
370
379
  elif (m := re.match(r"(import|from)\s+(.*)", cmdl)):
371
380
  text, hints = m.groups()
372
381
  if not _continue(hints) and not force:
373
382
  self.message("[module]>>> waiting for key input...")
374
383
  return
375
384
  modules = self.modules
385
+ ## Module X.Y.Z
376
386
  else:
377
387
  text, sep, hint = self._get_words_hint()
378
388
  obj = self.eval(text)
@@ -401,11 +411,15 @@ class AutoCompInterfaceMixin:
401
411
  if not self.CanEdit():
402
412
  self.handler('quit', evt)
403
413
  return
414
+
415
+ text, sep, hint = self._get_words_hint()
416
+ if not text:
417
+ self.handler('quit', evt)
418
+ self.message("- No autocompletion candidates or hints found.")
419
+ return
404
420
  try:
405
- text, sep, hint = self._get_words_hint()
406
- obj = self.eval(text)
407
421
  ## dir = introspect.getAttributeNames @TODO in wx ver 4.2.3
408
-
422
+ obj = self.eval(text)
409
423
  P = re.compile(hint)
410
424
  p = re.compile(hint, re.I)
411
425
  words = sorted([x for x in dir(obj) if p.match(x)], key=lambda s:s.upper())
@@ -429,11 +443,15 @@ class AutoCompInterfaceMixin:
429
443
  if not self.CanEdit():
430
444
  self.handler('quit', evt)
431
445
  return
446
+
447
+ text, sep, hint = self._get_words_hint()
448
+ if not text:
449
+ self.handler('quit', evt)
450
+ self.message("- No autocompletion candidates or hints found.")
451
+ return
432
452
  try:
433
- text, sep, hint = self._get_words_hint()
434
- obj = self.eval(text)
435
453
  ## dir = introspect.getAttributeNames @TODO in wx ver 4.2.3.
436
-
454
+ obj = self.eval(text)
437
455
  P = re.compile(hint)
438
456
  p = re.compile(hint, re.I)
439
457
  words = sorted([x for x in dir(obj) if p.search(x)], key=lambda s:s.upper())
@@ -559,7 +577,7 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
559
577
  self.SetKeyWords(1, ' '.join(builtins.__dict__)
560
578
  + ' '.join(_dunders(type, int, float, str, bytes,
561
579
  tuple, list, range, operator,))
562
- + ' self this')
580
+ + ' self this shell')
563
581
 
564
582
  ## AutoComp setting
565
583
  self.AutoCompSetAutoHide(False)
@@ -867,7 +885,7 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
867
885
  return sty
868
886
 
869
887
  def get_char(self, pos):
870
- """Returns the character at the given position."""
888
+ """Return the character at the given position."""
871
889
  return chr(self.GetCharAt(pos))
872
890
 
873
891
  def get_text(self, start, end):
@@ -1018,7 +1036,7 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
1018
1036
 
1019
1037
  @classmethod
1020
1038
  def py_calc_indentation(self, text):
1021
- """Returns indent spaces for the command text."""
1039
+ """Return indent spaces for the command text."""
1022
1040
  text = self.py_strip_comments(text)
1023
1041
  lstr, indent = self.py_strip_indents(text)
1024
1042
  text = text.rstrip()
@@ -1032,7 +1050,7 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
1032
1050
 
1033
1051
  @classmethod
1034
1052
  def py_strip_indents(self, text):
1035
- """Returns left-stripped text and the number of indent spaces."""
1053
+ """Return left-stripped text and the number of indent spaces."""
1036
1054
  text = self.py_strip_prompts(text) # cf. shell.lstripPrompt(text)
1037
1055
  lstr = text.lstrip(' \t')
1038
1056
  indent = len(text) - len(lstr)
@@ -1040,7 +1058,7 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
1040
1058
 
1041
1059
  @classmethod
1042
1060
  def py_strip_prompts(self, text):
1043
- """Returns text without a leading prompt."""
1061
+ """Return text without a leading prompt."""
1044
1062
  for ps in (sys.ps1, sys.ps2, sys.ps3):
1045
1063
  if text.startswith(ps):
1046
1064
  text = text[len(ps):]
@@ -1049,7 +1067,7 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
1049
1067
 
1050
1068
  @classmethod
1051
1069
  def py_strip_comments(self, text):
1052
- """Returns text without comments."""
1070
+ """Return text without comments."""
1053
1071
  return ''.join(split_tokens(text, comment=False))
1054
1072
 
1055
1073
  ## --------------------------------
@@ -1783,14 +1801,14 @@ class Buffer(EditorInterface, EditWindow):
1783
1801
 
1784
1802
  @property
1785
1803
  def need_buffer_save(self):
1786
- """Returns whether the buffer should be saved.
1804
+ """Return whether the buffer should be saved.
1787
1805
  The file has been modified internally.
1788
1806
  """
1789
1807
  return self.mtdelta is not None and self.IsModified()
1790
1808
 
1791
1809
  @property
1792
1810
  def need_buffer_load(self):
1793
- """Returns whether the buffer should be loaded.
1811
+ """Return whether the buffer should be loaded.
1794
1812
  The file has been modified externally.
1795
1813
  """
1796
1814
  return self.mtdelta is not None and self.mtdelta > 0
@@ -1854,11 +1872,6 @@ class Buffer(EditorInterface, EditWindow):
1854
1872
  self.ReplaceSelection('')
1855
1873
  self.message("")
1856
1874
 
1857
- def clear_autocomp(evt):
1858
- if self.AutoCompActive():
1859
- self.AutoCompCancel()
1860
- self.message("")
1861
-
1862
1875
  def fork(evt):
1863
1876
  self.handler.fork(self.handler.current_event, evt)
1864
1877
 
@@ -1891,15 +1904,14 @@ class Buffer(EditorInterface, EditWindow):
1891
1904
  '*button* pressed' : (0, skip, dispatch),
1892
1905
  'escape pressed' : (-1, self.on_enter_escmap),
1893
1906
  'C-h pressed' : (0, self.call_helpTip),
1894
- '. pressed' : (2, self.OnEnterDot),
1895
1907
  'C-. pressed' : (2, self.call_word_autocomp),
1896
1908
  'C-/ pressed' : (3, self.call_apropos_autocomp),
1897
1909
  'M-. pressed' : (2, self.call_word_autocomp),
1898
1910
  'M-/ pressed' : (3, self.call_apropos_autocomp),
1899
1911
  },
1900
1912
  2 : { # word auto completion AS-mode
1901
- 'quit' : (0, clear_autocomp),
1902
- '* pressed' : (0, clear_autocomp, fork),
1913
+ 'quit' : (0, self.clear_autocomp),
1914
+ '* pressed' : (0, self.clear_autocomp, fork),
1903
1915
  'tab pressed' : (0, clear, skip),
1904
1916
  'enter pressed' : (0, clear, skip),
1905
1917
  'escape pressed' : (0, clear, skip),
@@ -1917,7 +1929,7 @@ class Buffer(EditorInterface, EditWindow):
1917
1929
  '*delete pressed' : (2, skip),
1918
1930
  '*backspace pressed' : (2, skip),
1919
1931
  '*backspace released' : (2, self.call_word_autocomp),
1920
- '*S-backspace pressed' : (0, clear_autocomp, fork),
1932
+ '*S-backspace pressed' : (0, self.clear_autocomp, fork),
1921
1933
  '*alt pressed' : (2, ),
1922
1934
  '*ctrl pressed' : (2, ),
1923
1935
  '*shift pressed' : (2, ),
@@ -1925,8 +1937,8 @@ class Buffer(EditorInterface, EditWindow):
1925
1937
  '*f[0-9]* pressed' : (2, ),
1926
1938
  },
1927
1939
  3 : { # apropos auto completion AS-mode
1928
- 'quit' : (0, clear_autocomp),
1929
- '* pressed' : (0, clear_autocomp, fork),
1940
+ 'quit' : (0, self.clear_autocomp),
1941
+ '* pressed' : (0, self.clear_autocomp, fork),
1930
1942
  'tab pressed' : (0, clear, skip),
1931
1943
  'enter pressed' : (0, clear, skip),
1932
1944
  'escape pressed' : (0, clear, skip),
@@ -1944,7 +1956,7 @@ class Buffer(EditorInterface, EditWindow):
1944
1956
  '*delete pressed' : (3, skip),
1945
1957
  '*backspace pressed' : (3, skip),
1946
1958
  '*backspace released' : (3, self.call_apropos_autocomp),
1947
- '*S-backspace pressed' : (0, clear_autocomp, fork),
1959
+ '*S-backspace pressed' : (0, self.clear_autocomp, fork),
1948
1960
  '*alt pressed' : (3, ),
1949
1961
  '*ctrl pressed' : (3, ),
1950
1962
  '*shift pressed' : (3, ),
@@ -2016,14 +2028,6 @@ class Buffer(EditorInterface, EditWindow):
2016
2028
  self.update_caption()
2017
2029
  evt.Skip()
2018
2030
 
2019
- def OnEnterDot(self, evt):
2020
- p = self.cpos
2021
- lst = self.get_style(p-1)
2022
- rst = self.get_style(p)
2023
- if lst not in ('moji', 'word', 'rparen') or rst == 'word':
2024
- self.handler('quit', evt) # don't enter autocomp
2025
- evt.Skip()
2026
-
2027
2031
  def on_activated(self, buf):
2028
2032
  """Called when the buffer is activated."""
2029
2033
  self.update_caption()
@@ -2116,6 +2120,7 @@ class Buffer(EditorInterface, EditWindow):
2116
2120
  sender=self, command=None, more=False)
2117
2121
 
2118
2122
  def eval_line(self):
2123
+ """Evaluate the selected word or line and show calltips."""
2119
2124
  if self.CallTipActive():
2120
2125
  self.CallTipCancel()
2121
2126
 
@@ -2140,6 +2145,7 @@ class Buffer(EditorInterface, EditWindow):
2140
2145
  self.message("No words")
2141
2146
 
2142
2147
  def exec_region(self):
2148
+ """Execute a region of code."""
2143
2149
  try:
2144
2150
  code = compile(self.Text, self.filename, "exec")
2145
2151
  exec(code, self.globals, self.locals)
@@ -2329,7 +2335,7 @@ class EditorBook(AuiNotebook, CtrlInterface):
2329
2335
 
2330
2336
  @property
2331
2337
  def buffer(self):
2332
- """Returns the currently selected page or None."""
2338
+ """Return the currently selected page or None."""
2333
2339
  return self.CurrentPage
2334
2340
 
2335
2341
  def find_buffer(self, fn):
@@ -2807,11 +2813,6 @@ class Nautilus(EditorInterface, Shell):
2807
2813
  self.ReplaceSelection('')
2808
2814
  self.message("")
2809
2815
 
2810
- def clear_autocomp(evt):
2811
- if self.AutoCompActive():
2812
- self.AutoCompCancel()
2813
- self.message("")
2814
-
2815
2816
  def fork(evt):
2816
2817
  self.handler.fork(self.handler.current_event, evt)
2817
2818
 
@@ -2867,10 +2868,10 @@ class Nautilus(EditorInterface, Shell):
2867
2868
  'M-j pressed' : (0, _F(self.exec_region)),
2868
2869
  'C-h pressed' : (0, self.call_helpTip),
2869
2870
  'M-h pressed' : (0, self.call_helpDoc),
2870
- '. pressed' : (2, self.OnEnterDot),
2871
2871
  'tab pressed' : (1, self.call_history_comp),
2872
2872
  'M-p pressed' : (1, self.call_history_comp),
2873
2873
  'M-n pressed' : (1, self.call_history_comp),
2874
+ '. pressed' : (2, self.OnEnterDot),
2874
2875
  'C-. pressed' : (2, self.call_word_autocomp),
2875
2876
  'C-/ pressed' : (3, self.call_apropos_autocomp),
2876
2877
  'C-, pressed' : (4, self.call_text_autocomp),
@@ -2906,8 +2907,8 @@ class Nautilus(EditorInterface, Shell):
2906
2907
  '*f[0-9]* pressed' : (1, ),
2907
2908
  },
2908
2909
  2 : { # word auto completion AS-mode
2909
- 'quit' : (0, clear_autocomp),
2910
- '* pressed' : (0, clear_autocomp, fork),
2910
+ 'quit' : (0, self.clear_autocomp),
2911
+ '* pressed' : (0, self.clear_autocomp, fork),
2911
2912
  'tab pressed' : (0, clear, skip),
2912
2913
  'enter pressed' : (0, clear, skip),
2913
2914
  'escape pressed' : (0, clear, skip),
@@ -2925,7 +2926,7 @@ class Nautilus(EditorInterface, Shell):
2925
2926
  '*delete pressed' : (2, skip),
2926
2927
  '*backspace pressed' : (2, self.OnBackspace),
2927
2928
  '*backspace released' : (2, self.call_word_autocomp),
2928
- '*S-backspace pressed' : (0, clear_autocomp, fork),
2929
+ '*S-backspace pressed' : (0, self.clear_autocomp, fork),
2929
2930
  'C-j pressed' : (2, _F(self.eval_line)),
2930
2931
  '*alt pressed' : (2, ),
2931
2932
  '*ctrl pressed' : (2, ),
@@ -2934,8 +2935,8 @@ class Nautilus(EditorInterface, Shell):
2934
2935
  '*f[0-9]* pressed' : (2, ),
2935
2936
  },
2936
2937
  3 : { # apropos auto completion AS-mode
2937
- 'quit' : (0, clear_autocomp),
2938
- '* pressed' : (0, clear_autocomp, fork),
2938
+ 'quit' : (0, self.clear_autocomp),
2939
+ '* pressed' : (0, self.clear_autocomp, fork),
2939
2940
  'tab pressed' : (0, clear, skip),
2940
2941
  'enter pressed' : (0, clear, skip),
2941
2942
  'escape pressed' : (0, clear, skip),
@@ -2953,7 +2954,7 @@ class Nautilus(EditorInterface, Shell):
2953
2954
  '*delete pressed' : (3, skip),
2954
2955
  '*backspace pressed' : (3, self.OnBackspace),
2955
2956
  '*backspace released' : (3, self.call_apropos_autocomp),
2956
- '*S-backspace pressed' : (0, clear_autocomp, fork),
2957
+ '*S-backspace pressed' : (0, self.clear_autocomp, fork),
2957
2958
  'C-j pressed' : (3, _F(self.eval_line)),
2958
2959
  '*alt pressed' : (3, ),
2959
2960
  '*ctrl pressed' : (3, ),
@@ -2962,8 +2963,8 @@ class Nautilus(EditorInterface, Shell):
2962
2963
  '*f[0-9]* pressed' : (3, ),
2963
2964
  },
2964
2965
  4 : { # text auto completion AS-mode
2965
- 'quit' : (0, clear_autocomp),
2966
- '* pressed' : (0, clear_autocomp, fork),
2966
+ 'quit' : (0, self.clear_autocomp),
2967
+ '* pressed' : (0, self.clear_autocomp, fork),
2967
2968
  'tab pressed' : (0, clear, skip),
2968
2969
  'enter pressed' : (0, clear, skip),
2969
2970
  'escape pressed' : (0, clear, skip),
@@ -2981,7 +2982,7 @@ class Nautilus(EditorInterface, Shell):
2981
2982
  '*delete pressed' : (4, skip),
2982
2983
  '*backspace pressed' : (4, self.OnBackspace),
2983
2984
  '*backspace released' : (4, self.call_text_autocomp),
2984
- '*S-backspace pressed' : (0, clear_autocomp, fork),
2985
+ '*S-backspace pressed' : (0, self.clear_autocomp, fork),
2985
2986
  'C-j pressed' : (4, _F(self.eval_line)),
2986
2987
  '*alt pressed' : (4, ),
2987
2988
  '*ctrl pressed' : (4, ),
@@ -2990,8 +2991,8 @@ class Nautilus(EditorInterface, Shell):
2990
2991
  '*f[0-9]* pressed' : (4, ),
2991
2992
  },
2992
2993
  5 : { # module auto completion AS-mode
2993
- 'quit' : (0, clear_autocomp),
2994
- '* pressed' : (0, clear_autocomp, fork),
2994
+ 'quit' : (0, self.clear_autocomp),
2995
+ '* pressed' : (0, self.clear_autocomp, fork),
2995
2996
  'tab pressed' : (0, clear, skip),
2996
2997
  'enter pressed' : (0, clear, skip),
2997
2998
  'escape pressed' : (0, clear, skip),
@@ -3006,11 +3007,12 @@ class Nautilus(EditorInterface, Shell):
3006
3007
  'S-[a-z\\] pressed' : (5, skip),
3007
3008
  'S-[a-z\\] released' : (5, self.call_module_autocomp),
3008
3009
  '\\ released' : (5, self.call_module_autocomp),
3010
+ 'C-m pressed' : (5, _F(self.call_module_autocomp, force=1)),
3009
3011
  'M-m pressed' : (5, _F(self.call_module_autocomp, force=1)),
3010
3012
  '*delete pressed' : (5, skip),
3011
3013
  '*backspace pressed' : (5, self.OnBackspace),
3012
3014
  '*backspace released' : (5, self.call_module_autocomp),
3013
- '*S-backspace pressed' : (0, clear_autocomp, fork),
3015
+ '*S-backspace pressed' : (0, self.clear_autocomp, fork),
3014
3016
  '*alt pressed' : (5, ),
3015
3017
  '*ctrl pressed' : (5, ),
3016
3018
  '*shift pressed' : (5, ),
@@ -3626,7 +3628,7 @@ class Nautilus(EditorInterface, Shell):
3626
3628
  ## --------------------------------
3627
3629
 
3628
3630
  def eval_line(self):
3629
- """Evaluate the selected word or line."""
3631
+ """Evaluate the selected word or line and show calltips."""
3630
3632
  if self.CallTipActive():
3631
3633
  self.CallTipCancel()
3632
3634
 
@@ -3654,7 +3656,7 @@ class Nautilus(EditorInterface, Shell):
3654
3656
  self.message("No words")
3655
3657
 
3656
3658
  def exec_region(self):
3657
- """Execute the the selected region."""
3659
+ """Execute a region of code."""
3658
3660
  if self.CallTipActive():
3659
3661
  self.CallTipCancel()
3660
3662
 
mwx/wxwit.py CHANGED
@@ -92,7 +92,7 @@ class Inspector(it.InspectionTree, CtrlInterface):
92
92
  self.BuildTree(obj)
93
93
 
94
94
  def GetTextForWidget(self, obj):
95
- """Returns the string to be used in the tree for a widget.
95
+ """Return the string to be used in the tree for a widget.
96
96
 
97
97
  (override) Make better object name and Id.
98
98
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mwxlib
3
- Version: 1.4.12
3
+ Version: 1.4.15
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,20 +1,20 @@
1
1
  mwx/__init__.py,sha256=pS7ZG8QKRypiFFiaWAq_opBB6I_1viZ0zUMk2TbjzE0,667
2
2
  mwx/bookshelf.py,sha256=XbJ9HUH5COUm-BVI7iLC7gr9Hj9l-sFjOoaCAqNS4aA,8178
3
- mwx/controls.py,sha256=1zLWlPy0RTLHYlvxjz3ulDoTx3-uPUD3TqK7dGRA4wg,49563
4
- mwx/framework.py,sha256=oPLhLLRIoT9fudPsA6c9YzvThQdg4rJmmvShOlGMTSk,76909
5
- mwx/graphman.py,sha256=DDbmfZz29kVInzZ2NufYISd03ezKGtZdPyFZ5wDgKA0,70064
3
+ mwx/controls.py,sha256=TyXDovOo52XaiZQW4nW_JxOYPdszLsXUwPOY04KXOzM,49903
4
+ mwx/framework.py,sha256=0bNeso5KBFhb3keziq-Y8v-N2ko6KkxXLl7NCZ7L50c,76905
5
+ mwx/graphman.py,sha256=RlIQ_jhwv2870rC_R0xWCHFv5VsLzT8InidDKobKFes,70270
6
6
  mwx/images.py,sha256=Kkfy9QI_hMtwShSjUS4-ZpC_EkVuah_XhpBOR4wAKkM,49792
7
7
  mwx/matplot2.py,sha256=A2PbHI5UcuAvINfnm6GG7CXpbexhzvtyVLQOwcbRqnc,33015
8
- mwx/matplot2g.py,sha256=hUU1afbM6q7DQe6mU91m38odcnVo8B4e97xPvaQbshI,65282
8
+ mwx/matplot2g.py,sha256=3FD45UDkrWrypMDTUQx6SL5jU6fCdjXsJtH3k_GDUL0,65373
9
9
  mwx/matplot2lg.py,sha256=cb0EZXivccDQu4oFj5ddSUF9pEE4f5UuFJJK2ELItww,27404
10
10
  mwx/mgplt.py,sha256=8mXbHpCmm7lz3XbAxOg7IVC7DaSGBEby1UfTlMl9kjk,5604
11
- mwx/nutshell.py,sha256=J50NGi_6CmCJQZEBZt8QpxAQF97y2-tRf9xw49RAyQc,143114
11
+ mwx/nutshell.py,sha256=FNQ5GgXVnjDu9mmf9dyxk1TmuICUXF9tLWL6o5CssQQ,143418
12
12
  mwx/testsuite.py,sha256=Zk75onPSEn2tf0swS3l-vIn6yTXGB7allIyvJsPHj20,1229
13
13
  mwx/utilus.py,sha256=ObXYWsDVn5DmjvwVQgP2HGAhrdxlDrwL7g9pMCDbU7U,38127
14
14
  mwx/wxmon.py,sha256=yzWqrbY6LzpfRwQeytYUeqFhFuLVm_XEvrVAL_k0HBQ,12756
15
15
  mwx/wxpdb.py,sha256=ih2iLcOgYnUX849YXO4niIYue6amuoG7nWdpr-X1jFw,18839
16
16
  mwx/wxwil.py,sha256=hhyB1lPrF9ixeObxCOKQv0Theu-B-kpJg_yVU3EGSNg,5406
17
- mwx/wxwit.py,sha256=1hHtMi2YEy2T_LnUpwdmrIdtCuvxMOFyykqnbq6jLP0,7294
17
+ mwx/wxwit.py,sha256=PNgCNDGgT-AWjISOSfPQWyQSZ7JW3d8FyndptQw6OIY,7293
18
18
  mwx/plugins/__init__.py,sha256=jnJ-Sl9XJ_7BFDslD_r7dsbxsOT57q_IaEriV53XIGY,41
19
19
  mwx/plugins/ffmpeg_view.py,sha256=r7cQPe8anAWoIn3HU_YyWRpsTJrvzji97LNIO1Gw0e0,11031
20
20
  mwx/plugins/fft_view.py,sha256=08A_Y73XirV7kXpwf-v0mUA0Hr0MOfdMXv3tvL1hvWA,2789
@@ -22,7 +22,7 @@ mwx/plugins/frame_listview.py,sha256=gowjQ-ARNonMkDSXkQgPKq4U9YBJ-vQ0jK2krBVOdCs
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.4.12.dist-info/METADATA,sha256=y041f7Y-CwmHeEzr7zHuXr7Wxu3zUQhVOYBcPd9dIbE,7382
26
- mwxlib-1.4.12.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
27
- mwxlib-1.4.12.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
- mwxlib-1.4.12.dist-info/RECORD,,
25
+ mwxlib-1.4.15.dist-info/METADATA,sha256=th_Xs4HOK4txWRlzIGgFcMkWUJ6vO_ddbjfYFzN6COs,7382
26
+ mwxlib-1.4.15.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
27
+ mwxlib-1.4.15.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
+ mwxlib-1.4.15.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (79.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5