mwxlib 0.99.1__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 +24 -30
- mwx/framework.py +3 -9
- mwx/graphman.py +18 -8
- mwx/nutshell.py +89 -66
- mwx/utilus.py +1 -1
- {mwxlib-0.99.1.dist-info → mwxlib-0.99.3.dist-info}/METADATA +1 -1
- {mwxlib-0.99.1.dist-info → mwxlib-0.99.3.dist-info}/RECORD +10 -10
- {mwxlib-0.99.1.dist-info → mwxlib-0.99.3.dist-info}/WHEEL +1 -1
- {mwxlib-0.99.1.dist-info → mwxlib-0.99.3.dist-info}/LICENSE +0 -0
- {mwxlib-0.99.1.dist-info → mwxlib-0.99.3.dist-info}/top_level.txt +0 -0
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
|
|
10
|
+
from .utilus import SSM
|
|
11
11
|
from .utilus import funcall as _F
|
|
12
12
|
from .framework import pack, Menu, CtrlInterface
|
|
13
13
|
|
|
@@ -25,25 +25,26 @@ class Param:
|
|
|
25
25
|
|
|
26
26
|
Args:
|
|
27
27
|
name : label
|
|
28
|
-
range :
|
|
28
|
+
range : list of values
|
|
29
29
|
value : std_value (default is None)
|
|
30
30
|
fmt : text formatter or format:str (default is '%g')
|
|
31
31
|
`hex` specifies hexadecimal format
|
|
32
|
-
handler : called when
|
|
33
|
-
updater : called when
|
|
32
|
+
handler : called when knob is handled.
|
|
33
|
+
updater : called when button is pressed.
|
|
34
|
+
checker : called when tick turns on/off.
|
|
34
35
|
|
|
35
36
|
Attributes:
|
|
36
37
|
knobs : knob list
|
|
37
38
|
callback : single state machine that handles following events
|
|
38
39
|
|
|
39
|
-
- control -> when index changed by knobs or reset (handler)
|
|
40
|
-
-
|
|
41
|
-
-
|
|
40
|
+
- control -> when index is changed by knobs or reset (handler)
|
|
41
|
+
- updated -> when button is pressed (updater)
|
|
42
|
+
- checked -> when tick turns on/off (checker)
|
|
42
43
|
- overflow -> when value overflows
|
|
43
44
|
- underflow -> when value underflows
|
|
44
45
|
"""
|
|
45
46
|
def __init__(self, name, range=None, value=None, fmt=None,
|
|
46
|
-
handler=None, updater=None):
|
|
47
|
+
handler=None, updater=None, checker=None):
|
|
47
48
|
self.knobs = []
|
|
48
49
|
self.name = name
|
|
49
50
|
self.range = range
|
|
@@ -60,8 +61,8 @@ class Param:
|
|
|
60
61
|
self.__format = lambda v: fmt % v
|
|
61
62
|
self.callback = SSM({
|
|
62
63
|
'control' : [ _F(handler) ] if handler else [],
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
'updated' : [ _F(updater) ] if updater else [],
|
|
65
|
+
'checked' : [ _F(checker) ] if checker else [],
|
|
65
66
|
'overflow' : [],
|
|
66
67
|
'underflow' : [],
|
|
67
68
|
})
|
|
@@ -84,14 +85,6 @@ class Param:
|
|
|
84
85
|
def __len__(self):
|
|
85
86
|
return len(self.range)
|
|
86
87
|
|
|
87
|
-
def bind(self, action=None, target='control'):
|
|
88
|
-
warn("Use `Param.callback.bind('control')` instead.", DeprecationWarning)
|
|
89
|
-
return self.callback.bind(target, action)
|
|
90
|
-
|
|
91
|
-
def unbind(self, action=None, target='control'):
|
|
92
|
-
warn("Use `Param.callback.unbind('control')` instead.", DeprecationWarning)
|
|
93
|
-
return self.callback.unbind(target, action)
|
|
94
|
-
|
|
95
88
|
def reset(self, v=None, internal_callback=True):
|
|
96
89
|
"""Reset value when indexed (by knobs) with callback."""
|
|
97
90
|
if v is None:
|
|
@@ -110,13 +103,13 @@ class Param:
|
|
|
110
103
|
|
|
111
104
|
@property
|
|
112
105
|
def check(self):
|
|
113
|
-
"""A knob check
|
|
106
|
+
"""A knob check-flag (user defined)."""
|
|
114
107
|
return self.__check
|
|
115
108
|
|
|
116
109
|
@check.setter
|
|
117
110
|
def check(self, v):
|
|
118
111
|
self.__check = bool(v)
|
|
119
|
-
self.callback('
|
|
112
|
+
self.callback('checked', self)
|
|
120
113
|
|
|
121
114
|
@property
|
|
122
115
|
def name(self):
|
|
@@ -225,19 +218,21 @@ class LParam(Param):
|
|
|
225
218
|
|
|
226
219
|
Args:
|
|
227
220
|
name : label
|
|
228
|
-
range : range [min:max:step]
|
|
221
|
+
range : range params [min:max:step]
|
|
229
222
|
value : std_value (default is None)
|
|
230
223
|
fmt : text formatter or format:str (default is '%g')
|
|
231
224
|
`hex` specifies hexadecimal format
|
|
232
|
-
handler : called when
|
|
233
|
-
updater : called when
|
|
225
|
+
handler : called when knob is handled.
|
|
226
|
+
updater : called when button is pressed.
|
|
227
|
+
checker : called when tick turns on/off.
|
|
234
228
|
|
|
235
229
|
Attributes:
|
|
236
230
|
knobs : knob list
|
|
237
231
|
callback : single state machine that handles following events
|
|
238
232
|
|
|
239
|
-
- control -> when index changed by knobs or reset (handler)
|
|
240
|
-
-
|
|
233
|
+
- control -> when index is changed by knobs or reset (handler)
|
|
234
|
+
- updated -> when button is pressed (updater)
|
|
235
|
+
- checked -> when tick turns on/off (checker)
|
|
241
236
|
- overflow -> when value overflows
|
|
242
237
|
- underflow -> when value underflows
|
|
243
238
|
"""
|
|
@@ -296,8 +291,9 @@ class Knob(wx.Panel):
|
|
|
296
291
|
type : ctrl type (slider[*], [hv]spin, choice, None)
|
|
297
292
|
style : style of label
|
|
298
293
|
None -> static text (default)
|
|
299
|
-
chkbox -> label with check box
|
|
300
294
|
button -> label with flat button
|
|
295
|
+
chkbox -> label with checkbox
|
|
296
|
+
checkbox -> label with checkbox
|
|
301
297
|
cw : width of ctrl
|
|
302
298
|
lw : width of label
|
|
303
299
|
tw : width of textbox
|
|
@@ -339,19 +335,17 @@ class Knob(wx.Panel):
|
|
|
339
335
|
|
|
340
336
|
label = self.__par.name + ' '
|
|
341
337
|
|
|
342
|
-
if style == 'chkbox':
|
|
338
|
+
if style == 'chkbox' or style == 'checkbox':
|
|
343
339
|
if lw >= 0:
|
|
344
340
|
lw += 16
|
|
345
341
|
self.label = wx.CheckBox(self, label=label, size=(lw,-1))
|
|
346
342
|
self.label.Bind(wx.EVT_CHECKBOX, self.OnCheck)
|
|
347
|
-
|
|
348
343
|
elif style == 'button':
|
|
349
344
|
if lw >= 0:
|
|
350
345
|
lw += 16
|
|
351
346
|
self.label = pb.PlateButton(self, label=label, size=(lw,-1),
|
|
352
347
|
style=pb.PB_STYLE_DEFAULT|pb.PB_STYLE_SQUARE)
|
|
353
348
|
self.label.Bind(wx.EVT_BUTTON, self.OnPress)
|
|
354
|
-
|
|
355
349
|
elif not style:
|
|
356
350
|
self.label = wx.StaticText(self, label=label, size=(lw,-1))
|
|
357
351
|
else:
|
|
@@ -536,7 +530,7 @@ class Knob(wx.Panel):
|
|
|
536
530
|
evt.Skip()
|
|
537
531
|
|
|
538
532
|
def OnPress(self, evt): #<wx._core.CommandEvent>
|
|
539
|
-
self.__par.callback('
|
|
533
|
+
self.__par.callback('updated', self.__par)
|
|
540
534
|
evt.Skip()
|
|
541
535
|
|
|
542
536
|
def Enable(self, p=True):
|
mwx/framework.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#! python3
|
|
2
2
|
"""mwxlib framework.
|
|
3
3
|
"""
|
|
4
|
-
__version__ = "0.99.
|
|
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=
|
|
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
|
|
8
|
+
from pprint import pformat
|
|
9
|
+
from subprocess import Popen
|
|
10
10
|
import threading
|
|
11
11
|
import traceback
|
|
12
12
|
import inspect
|
|
@@ -336,6 +336,7 @@ class LayerInterface(CtrlInterface):
|
|
|
336
336
|
'thread_error' : [ None ], # failed in error
|
|
337
337
|
'page_shown' : [ None, _F(self.Draw, True) ],
|
|
338
338
|
'page_closed' : [ None, _F(self.Draw, False) ],
|
|
339
|
+
'page_hidden' : [ None, _F(self.Draw, False) ],
|
|
339
340
|
},
|
|
340
341
|
0 : {
|
|
341
342
|
'C-c pressed' : (0, _F(copy_params)),
|
|
@@ -380,6 +381,7 @@ class LayerInterface(CtrlInterface):
|
|
|
380
381
|
lambda v: Menu.Popup(self, self.menu))
|
|
381
382
|
|
|
382
383
|
self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy)
|
|
384
|
+
self.Bind(wx.EVT_SHOW, self.OnShow)
|
|
383
385
|
|
|
384
386
|
try:
|
|
385
387
|
self.Init()
|
|
@@ -419,6 +421,16 @@ class LayerInterface(CtrlInterface):
|
|
|
419
421
|
del self.Arts
|
|
420
422
|
evt.Skip()
|
|
421
423
|
|
|
424
|
+
def OnShow(self, evt):
|
|
425
|
+
if not self:
|
|
426
|
+
return
|
|
427
|
+
if isinstance(self.Parent, aui.AuiNotebook):
|
|
428
|
+
if evt.IsShown():
|
|
429
|
+
self.handler('page_shown', self)
|
|
430
|
+
else:
|
|
431
|
+
self.handler('page_hidden', self)
|
|
432
|
+
evt.Skip()
|
|
433
|
+
|
|
422
434
|
Shown = property(
|
|
423
435
|
lambda self: self.IsShown(),
|
|
424
436
|
lambda self,v: self.Show(v))
|
|
@@ -1001,7 +1013,7 @@ class Frame(mwx.Frame):
|
|
|
1001
1013
|
plug.handler('page_closed', plug)
|
|
1002
1014
|
else:
|
|
1003
1015
|
win.handler('page_closed', win)
|
|
1004
|
-
evt.Skip()
|
|
1016
|
+
evt.Skip(False) # Don't skip to avoid being called twice.
|
|
1005
1017
|
|
|
1006
1018
|
## --------------------------------
|
|
1007
1019
|
## Plugin <Layer> interface
|
|
@@ -1323,11 +1335,9 @@ class Frame(mwx.Frame):
|
|
|
1323
1335
|
plug = self.get_plug(name)
|
|
1324
1336
|
if not plug:
|
|
1325
1337
|
return
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
subprocess.Popen(cmd)
|
|
1330
|
-
self.message(cmd)
|
|
1338
|
+
|
|
1339
|
+
Popen([self.Editor,
|
|
1340
|
+
inspect.getmodule(plug).__file__])
|
|
1331
1341
|
|
|
1332
1342
|
def inspect_plug(self, name):
|
|
1333
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
|
-
|
|
524
|
-
|
|
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(
|
|
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(
|
|
3016
|
+
self.set_stylus(Stylus.py_shell_mode)
|
|
2994
3017
|
|
|
2995
3018
|
## delete unnecessary arrows at startup
|
|
2996
3019
|
del self.white_arrow
|
mwx/utilus.py
CHANGED
|
@@ -197,7 +197,7 @@ def typename(obj, docp=False, qualp=True):
|
|
|
197
197
|
|
|
198
198
|
modname = getattr(obj, '__module__', None)
|
|
199
199
|
if modname and modname != "__main__" and not modname.startswith('mwx'):
|
|
200
|
-
name = modname + '.' + name
|
|
200
|
+
name = modname + ('.' if qualp else '..') + name
|
|
201
201
|
|
|
202
202
|
if docp and callable(obj) and obj.__doc__:
|
|
203
203
|
name += "<{!r}>".format(obj.__doc__.splitlines()[0]) # concat the first doc line
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
mwx/__init__.py,sha256=nN62CGTWjME7Zz2h-jIRB8MxwuErIkHPGrlBzydkF0o,643
|
|
2
2
|
mwx/bookshelf.py,sha256=so-xSLq08sMlJBErTxOaDoKUAMa_g1CkIP2pNnff68c,5607
|
|
3
|
-
mwx/controls.py,sha256=
|
|
4
|
-
mwx/framework.py,sha256=
|
|
5
|
-
mwx/graphman.py,sha256=
|
|
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=
|
|
12
|
-
mwx/utilus.py,sha256=
|
|
11
|
+
mwx/nutshell.py,sha256=1lHjyrCY4J_wtRlMnJuLq6xn22ofWw6TrZPtGthXZyc,142080
|
|
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
|
|
15
15
|
mwx/wxwil.py,sha256=hhyB1lPrF9ixeObxCOKQv0Theu-B-kpJg_yVU3EGSNg,5406
|
|
@@ -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.
|
|
25
|
-
mwxlib-0.99.
|
|
26
|
-
mwxlib-0.99.
|
|
27
|
-
mwxlib-0.99.
|
|
28
|
-
mwxlib-0.99.
|
|
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,,
|
|
File without changes
|
|
File without changes
|