mwxlib 0.99.2__py3-none-any.whl → 0.99.3__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
@@ -7,7 +7,7 @@ import wx.lib.platebtn as pb
7
7
  import wx.lib.scrolledpanel as scrolled
8
8
 
9
9
  from . import images
10
- from .utilus import SSM, warn
10
+ from .utilus import SSM
11
11
  from .utilus import funcall as _F
12
12
  from .framework import pack, Menu, CtrlInterface
13
13
 
@@ -85,14 +85,6 @@ class Param:
85
85
  def __len__(self):
86
86
  return len(self.range)
87
87
 
88
- def bind(self, action=None, target='control'):
89
- warn("Use `Param.callback.bind('control')` instead.", DeprecationWarning)
90
- return self.callback.bind(target, action)
91
-
92
- def unbind(self, action=None, target='control'):
93
- warn("Use `Param.callback.unbind('control')` instead.", DeprecationWarning)
94
- return self.callback.unbind(target, action)
95
-
96
88
  def reset(self, v=None, internal_callback=True):
97
89
  """Reset value when indexed (by knobs) with callback."""
98
90
  if v is None:
mwx/framework.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #! python3
2
2
  """mwxlib framework.
3
3
  """
4
- __version__ = "0.99.2"
4
+ __version__ = "0.99.3"
5
5
  __author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
6
6
 
7
7
  from contextlib import contextmanager
@@ -1276,7 +1276,8 @@ class ShellFrame(MiniFrame):
1276
1276
  },
1277
1277
  })
1278
1278
 
1279
- self.Scratch.set_attributes(Style=Nautilus.STYLE)
1279
+ self.Scratch.set_attributes(Style=self.rootshell.get_stylus())
1280
+
1280
1281
  self.Log.set_attributes(ReadOnly=True)
1281
1282
  self.Help.set_attributes(ReadOnly=False)
1282
1283
 
@@ -1603,13 +1604,6 @@ class ShellFrame(MiniFrame):
1603
1604
  self.indicator.Value = 1
1604
1605
  self.message("Quit")
1605
1606
 
1606
- def _load(self, filename, lineno, editor): # for backward compatibility
1607
- """Load file in the session (internal use only)."""
1608
- if isinstance(editor, str):
1609
- editor = getattr(self, editor, None)
1610
- if editor:
1611
- return editor.load_file(filename, lineno)
1612
-
1613
1607
  @save_focus_excursion()
1614
1608
  def load(self, filename, lineno=0, show=True):
1615
1609
  """Load file @where the object is defined.
mwx/graphman.py CHANGED
@@ -4,9 +4,9 @@
4
4
  from functools import wraps
5
5
  from importlib import reload, import_module
6
6
  from contextlib import contextmanager
7
- from pprint import pformat
8
7
  from bdb import BdbQuit
9
- import subprocess
8
+ from pprint import pformat
9
+ from subprocess import Popen
10
10
  import threading
11
11
  import traceback
12
12
  import inspect
@@ -1335,11 +1335,9 @@ class Frame(mwx.Frame):
1335
1335
  plug = self.get_plug(name)
1336
1336
  if not plug:
1337
1337
  return
1338
- ## this = inspect.getmodule(plug)
1339
- this = self.plugins[plug.__module__]
1340
- cmd = '{} "{}"'.format(self.Editor, this.__file__)
1341
- subprocess.Popen(cmd)
1342
- self.message(cmd)
1338
+
1339
+ Popen([self.Editor,
1340
+ inspect.getmodule(plug).__file__])
1343
1341
 
1344
1342
  def inspect_plug(self, name):
1345
1343
  """Dive into the process to inspect plugs in the shell.
mwx/nutshell.py CHANGED
@@ -47,6 +47,90 @@ py_frame_re = r" +file '(.*?)', line ([0-9]+)"
47
47
  py_where_re = r'> +([^*?"<>|\r\n]+?):([0-9]+)'
48
48
  py_break_re = r'at ([^*?"<>|\r\n]+?):([0-9]+)'
49
49
 
50
+ ## Custom constants in wx.stc
51
+ stc.STC_P_WORD3 = 20 # deprecated
52
+ stc.STC_STYLE_CARETLINE = 40
53
+ stc.STC_STYLE_ANNOTATION = 41
54
+
55
+ class Stylus:
56
+ py_buffer_mode = {
57
+ stc.STC_STYLE_DEFAULT : "fore:#7f7f7f,back:#ffffb8,size:9,face:MS Gothic",
58
+ stc.STC_STYLE_LINENUMBER : "fore:#000000,back:#ffffb8,size:9",
59
+ stc.STC_STYLE_BRACELIGHT : "fore:#000000,back:#ffffb8,bold",
60
+ stc.STC_STYLE_BRACEBAD : "fore:#000000,back:#ff0000,bold",
61
+ stc.STC_STYLE_CONTROLCHAR : "size:6",
62
+ stc.STC_STYLE_CARETLINE : "fore:#000000,back:#ffff7f,size:2", # optional
63
+ stc.STC_STYLE_ANNOTATION : "fore:#7f0000,back:#ff7f7f", # optional
64
+ stc.STC_P_DEFAULT : "fore:#000000",
65
+ stc.STC_P_OPERATOR : "fore:#000000",
66
+ stc.STC_P_IDENTIFIER : "fore:#000000",
67
+ stc.STC_P_COMMENTLINE : "fore:#007f7f,back:#ffcfcf",
68
+ stc.STC_P_COMMENTBLOCK : "fore:#007f7f,back:#ffcfcf,eol",
69
+ stc.STC_P_NUMBER : "fore:#7f0000",
70
+ stc.STC_P_STRINGEOL : "fore:#000000,back:#ffcfcf",
71
+ stc.STC_P_CHARACTER : "fore:#7f7f7f",
72
+ stc.STC_P_STRING : "fore:#7f7f7f",
73
+ stc.STC_P_TRIPLE : "fore:#7f7f7f",
74
+ stc.STC_P_TRIPLEDOUBLE : "fore:#7f7f7f",
75
+ stc.STC_P_CLASSNAME : "fore:#7f00ff,bold",
76
+ stc.STC_P_DEFNAME : "fore:#0000ff,bold",
77
+ stc.STC_P_WORD : "fore:#0000ff",
78
+ stc.STC_P_WORD2 : "fore:#b8007f",
79
+ stc.STC_P_DECORATOR : "fore:#e08040",
80
+ }
81
+
82
+ py_text_mode = {
83
+ stc.STC_STYLE_DEFAULT : "fore:#7f7f7f,back:#fffff8,size:9,face:MS Gothic",
84
+ stc.STC_STYLE_LINENUMBER : "fore:#000000,back:#fffff8,size:9",
85
+ stc.STC_STYLE_BRACELIGHT : "fore:#000000,back:#cccccc,bold",
86
+ stc.STC_STYLE_BRACEBAD : "fore:#000000,back:#ff0000,bold",
87
+ stc.STC_STYLE_CONTROLCHAR : "size:6",
88
+ stc.STC_STYLE_CARETLINE : "fore:#000000,back:#f0f0ff,size:2", # optional
89
+ stc.STC_STYLE_ANNOTATION : "fore:#7f0000,back:#ff7f7f", # optional
90
+ stc.STC_P_DEFAULT : "fore:#000000",
91
+ stc.STC_P_OPERATOR : "fore:#000000",
92
+ stc.STC_P_IDENTIFIER : "fore:#000000",
93
+ stc.STC_P_COMMENTLINE : "fore:#007f00,back:#f0fff0",
94
+ stc.STC_P_COMMENTBLOCK : "fore:#007f00,back:#f0fff0,eol",
95
+ stc.STC_P_NUMBER : "fore:#e02000",
96
+ stc.STC_P_STRINGEOL : "fore:#7f7f7f,back:#ffc0c0,eol",
97
+ stc.STC_P_CHARACTER : "fore:#7f7f7f",
98
+ stc.STC_P_STRING : "fore:#7f7f7f",
99
+ stc.STC_P_TRIPLE : "fore:#7f7f7f",
100
+ stc.STC_P_TRIPLEDOUBLE : "fore:#7f7f7f",
101
+ stc.STC_P_CLASSNAME : "fore:#7f00ff,bold",
102
+ stc.STC_P_DEFNAME : "fore:#0000ff,bold",
103
+ stc.STC_P_WORD : "fore:#0000ff",
104
+ stc.STC_P_WORD2 : "fore:#7f007f",
105
+ stc.STC_P_DECORATOR : "fore:#c04040,bold",
106
+ }
107
+
108
+ py_shell_mode = {
109
+ stc.STC_STYLE_DEFAULT : "fore:#7f7f7f,back:#202020,size:9,face:MS Gothic",
110
+ stc.STC_STYLE_LINENUMBER : "fore:#000000,back:#f0f0f0,size:9",
111
+ stc.STC_STYLE_BRACELIGHT : "fore:#ffffff,back:#202020,bold",
112
+ stc.STC_STYLE_BRACEBAD : "fore:#ffffff,back:#ff0000,bold",
113
+ stc.STC_STYLE_CONTROLCHAR : "size:6",
114
+ stc.STC_STYLE_CARETLINE : "fore:#ffffff,back:#123460,size:2", # optional
115
+ stc.STC_STYLE_ANNOTATION : "fore:#7f0000,back:#ff7f7f", # optional
116
+ stc.STC_P_DEFAULT : "fore:#cccccc",
117
+ stc.STC_P_OPERATOR : "fore:#cccccc",
118
+ stc.STC_P_IDENTIFIER : "fore:#cccccc",
119
+ stc.STC_P_COMMENTLINE : "fore:#42c18c,back:#004040",
120
+ stc.STC_P_COMMENTBLOCK : "fore:#42c18c,back:#004040,eol",
121
+ stc.STC_P_NUMBER : "fore:#ffc080",
122
+ stc.STC_P_STRINGEOL : "fore:#cccccc,back:#004040,eol",
123
+ stc.STC_P_CHARACTER : "fore:#a0a0a0",
124
+ stc.STC_P_STRING : "fore:#a0a0a0",
125
+ stc.STC_P_TRIPLE : "fore:#a0a0a0,back:#004040",
126
+ stc.STC_P_TRIPLEDOUBLE : "fore:#a0a0a0,back:#004040",
127
+ stc.STC_P_CLASSNAME : "fore:#61d6d6,bold",
128
+ stc.STC_P_DEFNAME : "fore:#3a96ff,bold",
129
+ stc.STC_P_WORD : "fore:#80c0ff",
130
+ stc.STC_P_WORD2 : "fore:#ff80ff",
131
+ stc.STC_P_DECORATOR : "fore:#ff8040",
132
+ }
133
+
50
134
 
51
135
  def skip(evt):
52
136
  evt.Skip()
@@ -520,12 +604,8 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
520
604
 
521
605
  self.SetProperty('fold', '1') # Enable folder property
522
606
 
523
- ## if wx.VERSION >= (4,1,0):
524
- try:
525
- self.Bind(stc.EVT_STC_MARGINCLICK, self.OnMarginClick)
526
- self.Bind(stc.EVT_STC_MARGIN_RIGHT_CLICK, self.OnMarginRClick)
527
- except AttributeError:
528
- pass
607
+ self.Bind(stc.EVT_STC_MARGINCLICK, self.OnMarginClick)
608
+ self.Bind(stc.EVT_STC_MARGIN_RIGHT_CLICK, self.OnMarginRClick)
529
609
 
530
610
  ## Custom markers
531
611
  self.MarkerDefine(0, stc.STC_MARK_CIRCLE, '#007ff0', '#007ff0') # o mark
@@ -585,11 +665,6 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
585
665
  self.__mark = -1
586
666
  self.__stylus = {}
587
667
 
588
- ## Custom constants embedded in wx.stc
589
- stc.STC_P_WORD3 = 20 # deprecated
590
- stc.STC_STYLE_CARETLINE = 40
591
- stc.STC_STYLE_ANNOTATION = 41
592
-
593
668
  def OnDrag(self, evt): #<wx._core.StyledTextEvent>
594
669
  EditorInterface.__dnd_from = evt.EventObject
595
670
  try:
@@ -1079,6 +1154,7 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
1079
1154
  return self.__stylus
1080
1155
 
1081
1156
  def set_stylus(self, spec=None, **kwargs):
1157
+ """Set style spec for wx.stc.StyleSetSpec."""
1082
1158
  spec = spec and spec.copy() or {}
1083
1159
  spec.update(kwargs)
1084
1160
  if not spec:
@@ -1630,32 +1706,6 @@ class Buffer(EditorInterface, EditWindow):
1630
1706
  filename : buffer-file-name
1631
1707
  code : code object
1632
1708
  """
1633
- STYLE = {
1634
- stc.STC_STYLE_DEFAULT : "fore:#7f7f7f,back:#ffffb8,size:9,face:MS Gothic",
1635
- stc.STC_STYLE_LINENUMBER : "fore:#000000,back:#ffffb8,size:9",
1636
- stc.STC_STYLE_BRACELIGHT : "fore:#000000,back:#ffffb8,bold",
1637
- stc.STC_STYLE_BRACEBAD : "fore:#000000,back:#ff0000,bold",
1638
- stc.STC_STYLE_CONTROLCHAR : "size:6",
1639
- stc.STC_STYLE_CARETLINE : "fore:#000000,back:#ffff7f,size:2", # optional
1640
- stc.STC_STYLE_ANNOTATION : "fore:#7f0000,back:#ff7f7f", # optional
1641
- stc.STC_P_DEFAULT : "fore:#000000",
1642
- stc.STC_P_OPERATOR : "fore:#000000",
1643
- stc.STC_P_IDENTIFIER : "fore:#000000",
1644
- stc.STC_P_COMMENTLINE : "fore:#007f7f,back:#ffcfcf",
1645
- stc.STC_P_COMMENTBLOCK : "fore:#007f7f,back:#ffcfcf,eol",
1646
- stc.STC_P_NUMBER : "fore:#7f0000",
1647
- stc.STC_P_STRINGEOL : "fore:#000000,back:#ffcfcf",
1648
- stc.STC_P_CHARACTER : "fore:#7f7f7f",
1649
- stc.STC_P_STRING : "fore:#7f7f7f",
1650
- stc.STC_P_TRIPLE : "fore:#7f7f7f",
1651
- stc.STC_P_TRIPLEDOUBLE : "fore:#7f7f7f",
1652
- stc.STC_P_CLASSNAME : "fore:#7f00ff,bold",
1653
- stc.STC_P_DEFNAME : "fore:#0000ff,bold",
1654
- stc.STC_P_WORD : "fore:#0000ff",
1655
- stc.STC_P_WORD2 : "fore:#b8007f",
1656
- stc.STC_P_DECORATOR : "fore:#e08040",
1657
- }
1658
-
1659
1709
  @property
1660
1710
  def message(self):
1661
1711
  return self.parent.message
@@ -1880,7 +1930,7 @@ class Buffer(EditorInterface, EditWindow):
1880
1930
  })
1881
1931
 
1882
1932
  self.show_folder()
1883
- self.set_stylus(self.STYLE)
1933
+ self.set_stylus(Stylus.py_buffer_mode)
1884
1934
 
1885
1935
  def __contains__(self, code):
1886
1936
  if inspect.iscode(code) and self.code:
@@ -2208,7 +2258,6 @@ class EditorBook(AuiNotebook, CtrlInterface):
2208
2258
  buf : a buffer to apply (if None, applies to all buffers).
2209
2259
  **kwargs: default style.
2210
2260
 
2211
- Style = Buffer.STYLE
2212
2261
  ReadOnly = False
2213
2262
  UseTabs = False
2214
2263
  ViewEOL = False
@@ -2645,32 +2694,6 @@ class Nautilus(EditorInterface, Shell):
2645
2694
  Half-baked by Patrik K. O'Brien,
2646
2695
  and this other half by K. O'moto.
2647
2696
  """
2648
- STYLE = {
2649
- stc.STC_STYLE_DEFAULT : "fore:#7f7f7f,back:#202020,size:9,face:MS Gothic",
2650
- stc.STC_STYLE_LINENUMBER : "fore:#000000,back:#f0f0f0,size:9",
2651
- stc.STC_STYLE_BRACELIGHT : "fore:#ffffff,back:#202020,bold",
2652
- stc.STC_STYLE_BRACEBAD : "fore:#ffffff,back:#ff0000,bold",
2653
- stc.STC_STYLE_CONTROLCHAR : "size:6",
2654
- stc.STC_STYLE_CARETLINE : "fore:#ffffff,back:#123460,size:2", # optional
2655
- stc.STC_STYLE_ANNOTATION : "fore:#7f0000,back:#ff7f7f", # optional
2656
- stc.STC_P_DEFAULT : "fore:#cccccc",
2657
- stc.STC_P_OPERATOR : "fore:#cccccc",
2658
- stc.STC_P_IDENTIFIER : "fore:#cccccc",
2659
- stc.STC_P_COMMENTLINE : "fore:#42c18c,back:#004040",
2660
- stc.STC_P_COMMENTBLOCK : "fore:#42c18c,back:#004040,eol",
2661
- stc.STC_P_NUMBER : "fore:#ffc080",
2662
- stc.STC_P_STRINGEOL : "fore:#cccccc,back:#004040,eol",
2663
- stc.STC_P_CHARACTER : "fore:#a0a0a0",
2664
- stc.STC_P_STRING : "fore:#a0a0a0",
2665
- stc.STC_P_TRIPLE : "fore:#a0a0a0,back:#004040",
2666
- stc.STC_P_TRIPLEDOUBLE : "fore:#a0a0a0,back:#004040",
2667
- stc.STC_P_CLASSNAME : "fore:#61d6d6,bold",
2668
- stc.STC_P_DEFNAME : "fore:#3a96ff,bold",
2669
- stc.STC_P_WORD : "fore:#80c0ff",
2670
- stc.STC_P_WORD2 : "fore:#ff80ff",
2671
- stc.STC_P_DECORATOR : "fore:#ff8040",
2672
- }
2673
-
2674
2697
  @property
2675
2698
  def message(self):
2676
2699
  return self.parent.message
@@ -2990,7 +3013,7 @@ class Nautilus(EditorInterface, Shell):
2990
3013
 
2991
3014
  self.wrap(0)
2992
3015
  self.show_folder()
2993
- self.set_stylus(self.STYLE)
3016
+ self.set_stylus(Stylus.py_shell_mode)
2994
3017
 
2995
3018
  ## delete unnecessary arrows at startup
2996
3019
  del self.white_arrow
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mwxlib
3
- Version: 0.99.2
3
+ Version: 0.99.3
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,14 +1,14 @@
1
1
  mwx/__init__.py,sha256=nN62CGTWjME7Zz2h-jIRB8MxwuErIkHPGrlBzydkF0o,643
2
2
  mwx/bookshelf.py,sha256=so-xSLq08sMlJBErTxOaDoKUAMa_g1CkIP2pNnff68c,5607
3
- mwx/controls.py,sha256=1WTJEFeeGY9_gycGzHMQUdgBGgwc2QnvDnQPJ49bRZY,48053
4
- mwx/framework.py,sha256=dCQ_xwPssrjBpGYLwxQRlKRHf-kX4tumFgZlVt7iQ3Q,75587
5
- mwx/graphman.py,sha256=-klqkJ8h5Vi01Xe9H_N28m-59x2lbRe_ow3NHswnDZE,70433
3
+ mwx/controls.py,sha256=0UkLeyIsQU0uj--v1NYctx-GzqO36Z5rdeNpCsfIN10,47657
4
+ mwx/framework.py,sha256=YG3NHz8Jc0llVmlU22W9KOALESPJnjTc0zL5PQmwbQA,75304
5
+ mwx/graphman.py,sha256=s0qlaDIPFFvJaY7MeFNcEg4kxbF27jsyu-dJFgulo_U,70327
6
6
  mwx/images.py,sha256=_-Eh3xF7Khu42ivkYp97NXIzSNGbjcidqtWjZQFGtqE,47827
7
7
  mwx/matplot2.py,sha256=xCJ_ZzdDEWmzctpPaOrzTnwXyHINP4nfFHweoTZa6ug,32899
8
8
  mwx/matplot2g.py,sha256=gCXa8X1MEMP7n_mG73h3SkWKuNZOfjVKUTWNRXXK11c,64310
9
9
  mwx/matplot2lg.py,sha256=JRWjWnLJUytbSq6wxs4P0gbVUr3xoLSF6Wwqd5V_pJI,27404
10
10
  mwx/mgplt.py,sha256=0WJ1RN_Y0a4Y3rz1C_Lx-WhumtOMdb1N49guX9aZZ_o,5602
11
- mwx/nutshell.py,sha256=xoHTyWZ46geGy3u4aU8k8_-mr520EdGcvuQRO4TBU_A,140715
11
+ mwx/nutshell.py,sha256=1lHjyrCY4J_wtRlMnJuLq6xn22ofWw6TrZPtGthXZyc,142080
12
12
  mwx/utilus.py,sha256=iizdVrbwL1lX7eTfsMmltFz4IfHqTXVM37wwlPQ3A3Y,37346
13
13
  mwx/wxmon.py,sha256=Pq8XXigM_isJd80yiqG18iRVdArJpsePpxfnZOkk-Uw,12573
14
14
  mwx/wxpdb.py,sha256=lLowkkAgMhPFHAfklD7wZHq0qbSMjRxnBFtSajmVgME,19133
@@ -21,8 +21,8 @@ mwx/plugins/frame_listview.py,sha256=yEYPCdLHLSMTJwTv6iYAh3Lo4lJvYfp5BxTLP3FhW9Y
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=fumUG1F5M9TL-Dfqni4G85uk7TmvnUunTbdcPDV0vfo,16857
24
- mwxlib-0.99.2.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
- mwxlib-0.99.2.dist-info/METADATA,sha256=fLuVjSWTwHhXJmBuIEwD-HCdHHhFPVHnXapKkretuvQ,7411
26
- mwxlib-0.99.2.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
27
- mwxlib-0.99.2.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
- mwxlib-0.99.2.dist-info/RECORD,,
24
+ mwxlib-0.99.3.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
25
+ mwxlib-0.99.3.dist-info/METADATA,sha256=W98i-ZcPeMT7ctVJ055GvGZ_wKDf7LG0dWC9l_Wu13c,7411
26
+ mwxlib-0.99.3.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
27
+ mwxlib-0.99.3.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
28
+ mwxlib-0.99.3.dist-info/RECORD,,