mwxlib 0.99.2__py3-none-any.whl → 0.99.5__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/__init__.py +1 -1
- mwx/controls.py +1 -9
- mwx/framework.py +61 -57
- mwx/graphman.py +10 -13
- mwx/nutshell.py +91 -67
- {mwxlib-0.99.2.dist-info → mwxlib-0.99.5.dist-info}/METADATA +1 -1
- {mwxlib-0.99.2.dist-info → mwxlib-0.99.5.dist-info}/RECORD +10 -10
- {mwxlib-0.99.2.dist-info → mwxlib-0.99.5.dist-info}/LICENSE +0 -0
- {mwxlib-0.99.2.dist-info → mwxlib-0.99.5.dist-info}/WHEEL +0 -0
- {mwxlib-0.99.2.dist-info → mwxlib-0.99.5.dist-info}/top_level.txt +0 -0
mwx/__init__.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"""mwxlib framework (based on matplotlib/wx)
|
|
3
3
|
"""
|
|
4
4
|
from .framework import __version__, __author__
|
|
5
|
-
from .framework import FSM
|
|
5
|
+
from .framework import FSM, TreeList
|
|
6
6
|
from .framework import Menu, MenuBar, StatusBar
|
|
7
7
|
from .framework import Frame, MiniFrame, ShellFrame, deb
|
|
8
8
|
|
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
|
|
|
@@ -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.
|
|
4
|
+
__version__ = "0.99.5"
|
|
5
5
|
__author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
|
|
6
6
|
|
|
7
7
|
from contextlib import contextmanager
|
|
@@ -24,17 +24,18 @@ from .utilus import get_rootpath, ignore, warn
|
|
|
24
24
|
from .utilus import FSM, TreeList, apropos, typename, where, mro, pp
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
def deb(target=None, loop=True, locals=None, **kwargs):
|
|
27
|
+
def deb(target=None, loop=True, locals=None, debrc=None, **kwargs):
|
|
28
28
|
"""Dive into the process.
|
|
29
29
|
|
|
30
30
|
Args:
|
|
31
31
|
target : Object or module (default None).
|
|
32
32
|
If None, the target is set to `__main__`.
|
|
33
33
|
loop : If True, the app and the mainloop will be created.
|
|
34
|
-
Otherwise, neither the app nor the mainloop will be created.
|
|
35
34
|
locals : Additional context of the shell
|
|
35
|
+
debrc : file name of the session.
|
|
36
|
+
If None, the session will not be saved.
|
|
36
37
|
|
|
37
|
-
**kwargs: Nautilus arguments
|
|
38
|
+
**kwargs: Nautilus ShellFrame arguments
|
|
38
39
|
|
|
39
40
|
- introText : introductory of the shell
|
|
40
41
|
- startupScript : startup script file (default None)
|
|
@@ -45,25 +46,19 @@ def deb(target=None, loop=True, locals=None, **kwargs):
|
|
|
45
46
|
Note:
|
|
46
47
|
This will execute the startup script $(PYTHONSTARTUP).
|
|
47
48
|
"""
|
|
48
|
-
|
|
49
|
-
Anything one man can imagine, other man can make real.
|
|
50
|
-
--- Jules Verne (1828--1905)
|
|
51
|
-
"""
|
|
52
|
-
kwargs.setdefault("introText",
|
|
53
|
-
"mwx {}".format(__version__) + quote_unqoute)
|
|
49
|
+
kwargs.setdefault("introText", f"mwx {__version__}\n")
|
|
54
50
|
kwargs.setdefault("execStartupScript", True)
|
|
55
51
|
kwargs.setdefault("ensureClose", True)
|
|
56
|
-
|
|
52
|
+
|
|
57
53
|
app = wx.GetApp() or wx.App()
|
|
58
|
-
frame = ShellFrame(None, target, **kwargs)
|
|
54
|
+
frame = ShellFrame(None, target, session=debrc, **kwargs)
|
|
59
55
|
frame.Show()
|
|
60
56
|
frame.rootshell.SetFocus()
|
|
61
57
|
if locals:
|
|
62
58
|
frame.rootshell.locals.update(locals)
|
|
63
|
-
if not
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return app.MainLoop()
|
|
59
|
+
if loop and not app.GetMainLoop():
|
|
60
|
+
app.MainLoop()
|
|
61
|
+
return frame
|
|
67
62
|
|
|
68
63
|
|
|
69
64
|
def postcall(f):
|
|
@@ -741,7 +736,7 @@ class Frame(wx.Frame, KeyCtrlInterfaceMixin):
|
|
|
741
736
|
def __init__(self, *args, **kwargs):
|
|
742
737
|
wx.Frame.__init__(self, *args, **kwargs)
|
|
743
738
|
|
|
744
|
-
self.shellframe = ShellFrame(None, target=self)
|
|
739
|
+
self.shellframe = ShellFrame(None, target=self, session='')
|
|
745
740
|
|
|
746
741
|
self.menubar = MenuBar()
|
|
747
742
|
self.menubar["File"] = [
|
|
@@ -1065,10 +1060,8 @@ class ShellFrame(MiniFrame):
|
|
|
1065
1060
|
|
|
1066
1061
|
Args:
|
|
1067
1062
|
target : target object of the rootshell.
|
|
1068
|
-
If None, it will be
|
|
1069
|
-
|
|
1070
|
-
SESSION_FILE will be overwritten.
|
|
1071
|
-
ensureClose : A flag for the shell standalone.
|
|
1063
|
+
If None, it will be __main__.
|
|
1064
|
+
ensureClose : flag for the shell standalone.
|
|
1072
1065
|
If True, EVT_CLOSE will close the window.
|
|
1073
1066
|
Otherwise it will be only hidden.
|
|
1074
1067
|
**kwargs : Nautilus arguments
|
|
@@ -1104,18 +1097,14 @@ class ShellFrame(MiniFrame):
|
|
|
1104
1097
|
"""
|
|
1105
1098
|
rootshell = property(lambda self: self.__shell) #: the root shell
|
|
1106
1099
|
|
|
1107
|
-
def __init__(self, parent, target=None,
|
|
1108
|
-
|
|
1109
|
-
**kwargs):
|
|
1110
|
-
MiniFrame.__init__(self, parent, size=size, style=style)
|
|
1100
|
+
def __init__(self, parent, target=None, session=None, ensureClose=False, **kwargs):
|
|
1101
|
+
MiniFrame.__init__(self, parent, size=(1280,720), style=wx.DEFAULT_FRAME_STYLE)
|
|
1111
1102
|
|
|
1112
1103
|
self.statusbar.resize((-1,120))
|
|
1113
1104
|
self.statusbar.Show(1)
|
|
1114
1105
|
|
|
1115
1106
|
self.__standalone = bool(ensureClose)
|
|
1116
1107
|
|
|
1117
|
-
## Initialize self-specific builtins.
|
|
1118
|
-
## Note: This should be called before creating root shell.
|
|
1119
1108
|
self.Init()
|
|
1120
1109
|
|
|
1121
1110
|
from .nutshell import Nautilus, EditorBook
|
|
@@ -1276,30 +1265,17 @@ class ShellFrame(MiniFrame):
|
|
|
1276
1265
|
},
|
|
1277
1266
|
})
|
|
1278
1267
|
|
|
1279
|
-
|
|
1280
|
-
self.Log.set_attributes(ReadOnly=True)
|
|
1281
|
-
self.Help.set_attributes(ReadOnly=False)
|
|
1282
|
-
|
|
1283
|
-
self.set_hookable(self.Scratch)
|
|
1284
|
-
self.set_hookable(self.Log)
|
|
1285
|
-
|
|
1286
|
-
@self.Scratch.define_key('C-j')
|
|
1287
|
-
def eval_line(evt):
|
|
1288
|
-
self.Scratch.buffer.eval_line()
|
|
1289
|
-
evt.Skip(False) # Don't skip explicitly.
|
|
1290
|
-
|
|
1291
|
-
@self.Scratch.define_key('M-j')
|
|
1292
|
-
def eval_buffer(evt):
|
|
1293
|
-
self.Scratch.buffer.exec_region()
|
|
1294
|
-
evt.Skip(False) # Don't skip explicitly.
|
|
1295
|
-
|
|
1296
|
-
## Session
|
|
1268
|
+
## Session files
|
|
1297
1269
|
self.SESSION_FILE = get_rootpath(".debrc")
|
|
1298
1270
|
self.SCRATCH_FILE = get_rootpath("scratch.py")
|
|
1299
1271
|
self.LOGGING_FILE = get_rootpath("deb-logging.log")
|
|
1300
1272
|
|
|
1301
|
-
|
|
1302
|
-
|
|
1273
|
+
if session is not None:
|
|
1274
|
+
self.load_session(session or self.SESSION_FILE)
|
|
1275
|
+
else:
|
|
1276
|
+
self.SESSION_FILE = None
|
|
1277
|
+
|
|
1278
|
+
self.postInit()
|
|
1303
1279
|
|
|
1304
1280
|
def load_session(self, filename):
|
|
1305
1281
|
"""Load session from file.
|
|
@@ -1318,13 +1294,13 @@ class ShellFrame(MiniFrame):
|
|
|
1318
1294
|
## Re-open the *log* file.
|
|
1319
1295
|
self.add_log("#! Opened: <{}>\r\n".format(datetime.datetime.now()))
|
|
1320
1296
|
|
|
1321
|
-
|
|
1297
|
+
session = os.path.abspath(filename)
|
|
1322
1298
|
try:
|
|
1323
|
-
with open(
|
|
1299
|
+
with open(session) as i:
|
|
1324
1300
|
exec(i.read())
|
|
1325
1301
|
except FileNotFoundError:
|
|
1326
1302
|
pass
|
|
1327
|
-
self.SESSION_FILE =
|
|
1303
|
+
self.SESSION_FILE = session
|
|
1328
1304
|
|
|
1329
1305
|
## Reposition the window if it is not on the desktop.
|
|
1330
1306
|
if wx.Display.GetFromWindow(self) == -1:
|
|
@@ -1345,6 +1321,9 @@ class ShellFrame(MiniFrame):
|
|
|
1345
1321
|
_fsave(self.Scratch, self.SCRATCH_FILE) # save scratch
|
|
1346
1322
|
_fsave(self.Log, self.LOGGING_FILE) # save log
|
|
1347
1323
|
|
|
1324
|
+
if not self.SESSION_FILE:
|
|
1325
|
+
return
|
|
1326
|
+
|
|
1348
1327
|
with open(self.SESSION_FILE, 'w') as o:
|
|
1349
1328
|
o.write("#! Session file (This file is generated automatically)\n")
|
|
1350
1329
|
o.write("self.SetSize({})\n".format(self.Size))
|
|
@@ -1364,7 +1343,39 @@ class ShellFrame(MiniFrame):
|
|
|
1364
1343
|
"self._mgr.Update()\n",
|
|
1365
1344
|
)))
|
|
1366
1345
|
|
|
1346
|
+
def postInit(self):
|
|
1347
|
+
"""Set shell and editor styles.
|
|
1348
|
+
Note:
|
|
1349
|
+
This is called after loading session.
|
|
1350
|
+
"""
|
|
1351
|
+
from .nutshell import Stylus
|
|
1352
|
+
|
|
1353
|
+
self.Scratch.set_attributes(Style=Stylus.py_shell_mode)
|
|
1354
|
+
|
|
1355
|
+
self.Log.set_attributes(ReadOnly=True,
|
|
1356
|
+
Style=Stylus.py_log_mode)
|
|
1357
|
+
|
|
1358
|
+
self.Help.set_attributes(ReadOnly=False,
|
|
1359
|
+
Style=Stylus.py_text_mode)
|
|
1360
|
+
|
|
1361
|
+
self.set_hookable(self.Scratch)
|
|
1362
|
+
self.set_hookable(self.Log)
|
|
1363
|
+
|
|
1364
|
+
@self.Scratch.define_key('C-j')
|
|
1365
|
+
def eval_line(evt):
|
|
1366
|
+
self.Scratch.buffer.eval_line()
|
|
1367
|
+
evt.Skip(False) # Don't skip explicitly.
|
|
1368
|
+
|
|
1369
|
+
@self.Scratch.define_key('M-j')
|
|
1370
|
+
def eval_buffer(evt):
|
|
1371
|
+
self.Scratch.buffer.exec_region()
|
|
1372
|
+
evt.Skip(False) # Don't skip explicitly.
|
|
1373
|
+
|
|
1367
1374
|
def Init(self):
|
|
1375
|
+
"""Initialize self-specific builtins.
|
|
1376
|
+
Note:
|
|
1377
|
+
This should be called before creating root shell.
|
|
1378
|
+
"""
|
|
1368
1379
|
try:
|
|
1369
1380
|
builtins.dive
|
|
1370
1381
|
except AttributeError:
|
|
@@ -1603,13 +1614,6 @@ class ShellFrame(MiniFrame):
|
|
|
1603
1614
|
self.indicator.Value = 1
|
|
1604
1615
|
self.message("Quit")
|
|
1605
1616
|
|
|
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
1617
|
@save_focus_excursion()
|
|
1614
1618
|
def load(self, filename, lineno=0, show=True):
|
|
1615
1619
|
"""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
|
|
@@ -625,8 +625,8 @@ class Frame(mwx.Frame):
|
|
|
625
625
|
|
|
626
626
|
self.__plugins = {} # modules in the order of load/save
|
|
627
627
|
|
|
628
|
-
self.__graph = Graph(self, log=self.message, margin=None
|
|
629
|
-
self.__output = Graph(self, log=self.message, margin=None
|
|
628
|
+
self.__graph = Graph(self, log=self.message, margin=None)
|
|
629
|
+
self.__output = Graph(self, log=self.message, margin=None)
|
|
630
630
|
|
|
631
631
|
self.__histgrm = Histogram(self, log=self.message, margin=None, size=(130,65))
|
|
632
632
|
self.__histgrm.attach(self.graph)
|
|
@@ -822,14 +822,14 @@ class Frame(mwx.Frame):
|
|
|
822
822
|
## Accepts DnD
|
|
823
823
|
self.SetDropTarget(MyFileDropLoader(self.graph, self))
|
|
824
824
|
|
|
825
|
-
|
|
826
|
-
|
|
825
|
+
## Script editor for plugins (external call)
|
|
826
|
+
EDITOR = "notepad"
|
|
827
827
|
|
|
828
|
-
|
|
828
|
+
SYNC_SWITCH = True
|
|
829
829
|
|
|
830
830
|
def sync(self, a, b):
|
|
831
831
|
"""Synchronize b to a."""
|
|
832
|
-
if (self.
|
|
832
|
+
if (self.SYNC_SWITCH
|
|
833
833
|
and a.frame and b.frame
|
|
834
834
|
and a.frame.unit == b.frame.unit
|
|
835
835
|
and a.buffer.shape == b.buffer.shape):
|
|
@@ -1335,11 +1335,8 @@ class Frame(mwx.Frame):
|
|
|
1335
1335
|
plug = self.get_plug(name)
|
|
1336
1336
|
if not plug:
|
|
1337
1337
|
return
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
cmd = '{} "{}"'.format(self.Editor, this.__file__)
|
|
1341
|
-
subprocess.Popen(cmd)
|
|
1342
|
-
self.message(cmd)
|
|
1338
|
+
|
|
1339
|
+
Popen([self.EDITOR, inspect.getmodule(plug).__file__])
|
|
1343
1340
|
|
|
1344
1341
|
def inspect_plug(self, name):
|
|
1345
1342
|
"""Dive into the process to inspect plugs in the shell.
|
mwx/nutshell.py
CHANGED
|
@@ -17,7 +17,8 @@ import sys
|
|
|
17
17
|
import os
|
|
18
18
|
import re
|
|
19
19
|
import wx
|
|
20
|
-
from wx import
|
|
20
|
+
from wx import aui
|
|
21
|
+
from wx import stc
|
|
21
22
|
from wx.py import dispatcher
|
|
22
23
|
from wx.py import introspect
|
|
23
24
|
from wx.py import interpreter
|
|
@@ -47,6 +48,90 @@ py_frame_re = r" +file '(.*?)', line ([0-9]+)"
|
|
|
47
48
|
py_where_re = r'> +([^*?"<>|\r\n]+?):([0-9]+)'
|
|
48
49
|
py_break_re = r'at ([^*?"<>|\r\n]+?):([0-9]+)'
|
|
49
50
|
|
|
51
|
+
## Custom constants in wx.stc
|
|
52
|
+
stc.STC_P_WORD3 = 20 # deprecated
|
|
53
|
+
stc.STC_STYLE_CARETLINE = 40
|
|
54
|
+
stc.STC_STYLE_ANNOTATION = 41
|
|
55
|
+
|
|
56
|
+
class Stylus:
|
|
57
|
+
py_log_mode = {
|
|
58
|
+
stc.STC_STYLE_DEFAULT : "fore:#7f7f7f,back:#ffffb8,size:9,face:MS Gothic",
|
|
59
|
+
stc.STC_STYLE_LINENUMBER : "fore:#000000,back:#ffffb8,size:9",
|
|
60
|
+
stc.STC_STYLE_BRACELIGHT : "fore:#000000,back:#ffffb8,bold",
|
|
61
|
+
stc.STC_STYLE_BRACEBAD : "fore:#000000,back:#ff0000,bold",
|
|
62
|
+
stc.STC_STYLE_CONTROLCHAR : "size:6",
|
|
63
|
+
stc.STC_STYLE_CARETLINE : "fore:#000000,back:#ffff7f,size:2", # optional
|
|
64
|
+
stc.STC_STYLE_ANNOTATION : "fore:#7f0000,back:#ff7f7f", # optional
|
|
65
|
+
stc.STC_P_DEFAULT : "fore:#000000",
|
|
66
|
+
stc.STC_P_OPERATOR : "fore:#000000",
|
|
67
|
+
stc.STC_P_IDENTIFIER : "fore:#000000",
|
|
68
|
+
stc.STC_P_COMMENTLINE : "fore:#007f7f,back:#ffcfcf",
|
|
69
|
+
stc.STC_P_COMMENTBLOCK : "fore:#007f7f,back:#ffcfcf,eol",
|
|
70
|
+
stc.STC_P_NUMBER : "fore:#7f0000",
|
|
71
|
+
stc.STC_P_STRINGEOL : "fore:#000000,back:#ffcfcf",
|
|
72
|
+
stc.STC_P_CHARACTER : "fore:#7f7f7f",
|
|
73
|
+
stc.STC_P_STRING : "fore:#7f7f7f",
|
|
74
|
+
stc.STC_P_TRIPLE : "fore:#7f7f7f",
|
|
75
|
+
stc.STC_P_TRIPLEDOUBLE : "fore:#7f7f7f",
|
|
76
|
+
stc.STC_P_CLASSNAME : "fore:#7f00ff,bold",
|
|
77
|
+
stc.STC_P_DEFNAME : "fore:#0000ff,bold",
|
|
78
|
+
stc.STC_P_WORD : "fore:#0000ff",
|
|
79
|
+
stc.STC_P_WORD2 : "fore:#b8007f",
|
|
80
|
+
stc.STC_P_DECORATOR : "fore:#e08040",
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
py_text_mode = {
|
|
84
|
+
stc.STC_STYLE_DEFAULT : "fore:#7f7f7f,back:#fffff8,size:9,face:MS Gothic",
|
|
85
|
+
stc.STC_STYLE_LINENUMBER : "fore:#000000,back:#fffff8,size:9",
|
|
86
|
+
stc.STC_STYLE_BRACELIGHT : "fore:#000000,back:#cccccc,bold",
|
|
87
|
+
stc.STC_STYLE_BRACEBAD : "fore:#000000,back:#ff0000,bold",
|
|
88
|
+
stc.STC_STYLE_CONTROLCHAR : "size:6",
|
|
89
|
+
stc.STC_STYLE_CARETLINE : "fore:#000000,back:#f0f0ff,size:2", # optional
|
|
90
|
+
stc.STC_STYLE_ANNOTATION : "fore:#7f0000,back:#ff7f7f", # optional
|
|
91
|
+
stc.STC_P_DEFAULT : "fore:#000000",
|
|
92
|
+
stc.STC_P_OPERATOR : "fore:#000000",
|
|
93
|
+
stc.STC_P_IDENTIFIER : "fore:#000000",
|
|
94
|
+
stc.STC_P_COMMENTLINE : "fore:#007f00,back:#f0fff0",
|
|
95
|
+
stc.STC_P_COMMENTBLOCK : "fore:#007f00,back:#f0fff0,eol",
|
|
96
|
+
stc.STC_P_NUMBER : "fore:#e02000",
|
|
97
|
+
stc.STC_P_STRINGEOL : "fore:#7f7f7f,back:#ffc0c0,eol",
|
|
98
|
+
stc.STC_P_CHARACTER : "fore:#7f7f7f",
|
|
99
|
+
stc.STC_P_STRING : "fore:#7f7f7f",
|
|
100
|
+
stc.STC_P_TRIPLE : "fore:#7f7f7f",
|
|
101
|
+
stc.STC_P_TRIPLEDOUBLE : "fore:#7f7f7f",
|
|
102
|
+
stc.STC_P_CLASSNAME : "fore:#7f00ff,bold",
|
|
103
|
+
stc.STC_P_DEFNAME : "fore:#0000ff,bold",
|
|
104
|
+
stc.STC_P_WORD : "fore:#0000ff",
|
|
105
|
+
stc.STC_P_WORD2 : "fore:#7f007f",
|
|
106
|
+
stc.STC_P_DECORATOR : "fore:#c04040,bold",
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
py_shell_mode = {
|
|
110
|
+
stc.STC_STYLE_DEFAULT : "fore:#7f7f7f,back:#202020,size:9,face:MS Gothic",
|
|
111
|
+
stc.STC_STYLE_LINENUMBER : "fore:#000000,back:#f0f0f0,size:9",
|
|
112
|
+
stc.STC_STYLE_BRACELIGHT : "fore:#ffffff,back:#202020,bold",
|
|
113
|
+
stc.STC_STYLE_BRACEBAD : "fore:#ffffff,back:#ff0000,bold",
|
|
114
|
+
stc.STC_STYLE_CONTROLCHAR : "size:6",
|
|
115
|
+
stc.STC_STYLE_CARETLINE : "fore:#ffffff,back:#123460,size:2", # optional
|
|
116
|
+
stc.STC_STYLE_ANNOTATION : "fore:#7f0000,back:#ff7f7f", # optional
|
|
117
|
+
stc.STC_P_DEFAULT : "fore:#cccccc",
|
|
118
|
+
stc.STC_P_OPERATOR : "fore:#cccccc",
|
|
119
|
+
stc.STC_P_IDENTIFIER : "fore:#cccccc",
|
|
120
|
+
stc.STC_P_COMMENTLINE : "fore:#42c18c,back:#004040",
|
|
121
|
+
stc.STC_P_COMMENTBLOCK : "fore:#42c18c,back:#004040,eol",
|
|
122
|
+
stc.STC_P_NUMBER : "fore:#ffc080",
|
|
123
|
+
stc.STC_P_STRINGEOL : "fore:#cccccc,back:#004040,eol",
|
|
124
|
+
stc.STC_P_CHARACTER : "fore:#a0a0a0",
|
|
125
|
+
stc.STC_P_STRING : "fore:#a0a0a0",
|
|
126
|
+
stc.STC_P_TRIPLE : "fore:#a0a0a0,back:#004040",
|
|
127
|
+
stc.STC_P_TRIPLEDOUBLE : "fore:#a0a0a0,back:#004040",
|
|
128
|
+
stc.STC_P_CLASSNAME : "fore:#61d6d6,bold",
|
|
129
|
+
stc.STC_P_DEFNAME : "fore:#3a96ff,bold",
|
|
130
|
+
stc.STC_P_WORD : "fore:#80c0ff",
|
|
131
|
+
stc.STC_P_WORD2 : "fore:#ff80ff",
|
|
132
|
+
stc.STC_P_DECORATOR : "fore:#ff8040",
|
|
133
|
+
}
|
|
134
|
+
|
|
50
135
|
|
|
51
136
|
def skip(evt):
|
|
52
137
|
evt.Skip()
|
|
@@ -520,12 +605,8 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
|
|
|
520
605
|
|
|
521
606
|
self.SetProperty('fold', '1') # Enable folder property
|
|
522
607
|
|
|
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
|
|
608
|
+
self.Bind(stc.EVT_STC_MARGINCLICK, self.OnMarginClick)
|
|
609
|
+
self.Bind(stc.EVT_STC_MARGIN_RIGHT_CLICK, self.OnMarginRClick)
|
|
529
610
|
|
|
530
611
|
## Custom markers
|
|
531
612
|
self.MarkerDefine(0, stc.STC_MARK_CIRCLE, '#007ff0', '#007ff0') # o mark
|
|
@@ -585,11 +666,6 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
|
|
|
585
666
|
self.__mark = -1
|
|
586
667
|
self.__stylus = {}
|
|
587
668
|
|
|
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
669
|
def OnDrag(self, evt): #<wx._core.StyledTextEvent>
|
|
594
670
|
EditorInterface.__dnd_from = evt.EventObject
|
|
595
671
|
try:
|
|
@@ -1079,6 +1155,7 @@ class EditorInterface(AutoCompInterfaceMixin, CtrlInterface):
|
|
|
1079
1155
|
return self.__stylus
|
|
1080
1156
|
|
|
1081
1157
|
def set_stylus(self, spec=None, **kwargs):
|
|
1158
|
+
"""Set style spec for wx.stc.StyleSetSpec."""
|
|
1082
1159
|
spec = spec and spec.copy() or {}
|
|
1083
1160
|
spec.update(kwargs)
|
|
1084
1161
|
if not spec:
|
|
@@ -1630,32 +1707,6 @@ class Buffer(EditorInterface, EditWindow):
|
|
|
1630
1707
|
filename : buffer-file-name
|
|
1631
1708
|
code : code object
|
|
1632
1709
|
"""
|
|
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
1710
|
@property
|
|
1660
1711
|
def message(self):
|
|
1661
1712
|
return self.parent.message
|
|
@@ -1880,7 +1931,7 @@ class Buffer(EditorInterface, EditWindow):
|
|
|
1880
1931
|
})
|
|
1881
1932
|
|
|
1882
1933
|
self.show_folder()
|
|
1883
|
-
self.set_stylus(
|
|
1934
|
+
self.set_stylus(Stylus.py_text_mode)
|
|
1884
1935
|
|
|
1885
1936
|
def __contains__(self, code):
|
|
1886
1937
|
if inspect.iscode(code) and self.code:
|
|
@@ -2208,7 +2259,6 @@ class EditorBook(AuiNotebook, CtrlInterface):
|
|
|
2208
2259
|
buf : a buffer to apply (if None, applies to all buffers).
|
|
2209
2260
|
**kwargs: default style.
|
|
2210
2261
|
|
|
2211
|
-
Style = Buffer.STYLE
|
|
2212
2262
|
ReadOnly = False
|
|
2213
2263
|
UseTabs = False
|
|
2214
2264
|
ViewEOL = False
|
|
@@ -2645,32 +2695,6 @@ class Nautilus(EditorInterface, Shell):
|
|
|
2645
2695
|
Half-baked by Patrik K. O'Brien,
|
|
2646
2696
|
and this other half by K. O'moto.
|
|
2647
2697
|
"""
|
|
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
2698
|
@property
|
|
2675
2699
|
def message(self):
|
|
2676
2700
|
return self.parent.message
|
|
@@ -2990,7 +3014,7 @@ class Nautilus(EditorInterface, Shell):
|
|
|
2990
3014
|
|
|
2991
3015
|
self.wrap(0)
|
|
2992
3016
|
self.show_folder()
|
|
2993
|
-
self.set_stylus(
|
|
3017
|
+
self.set_stylus(Stylus.py_shell_mode)
|
|
2994
3018
|
|
|
2995
3019
|
## delete unnecessary arrows at startup
|
|
2996
3020
|
del self.white_arrow
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
mwx/__init__.py,sha256=
|
|
1
|
+
mwx/__init__.py,sha256=U7n9X8JAWdzOavKvVqecHdE4ooiXcCB5DSPCKWxfTnY,653
|
|
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=ROCF9XJ5nQMmwaDJFoOs3r2qsV7hM7bfBkR1MaGQSMg,75465
|
|
5
|
+
mwx/graphman.py,sha256=EZiRUKhPb6V-S1BcgFhsOQoaZvp4yw6F4SF45uUjla4,70266
|
|
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=
|
|
11
|
+
mwx/nutshell.py,sha256=etvpwPctuf9KhvIB1WZwTAaljYQ2ciMRfUWzmXW6NUo,142090
|
|
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.
|
|
25
|
-
mwxlib-0.99.
|
|
26
|
-
mwxlib-0.99.
|
|
27
|
-
mwxlib-0.99.
|
|
28
|
-
mwxlib-0.99.
|
|
24
|
+
mwxlib-0.99.5.dist-info/LICENSE,sha256=PGtRKCaTkmUDlBQwpptJAxJtdqxIUtAmdBsaT9nUVkA,1091
|
|
25
|
+
mwxlib-0.99.5.dist-info/METADATA,sha256=96mrQkWQoHslFbVsH5M7bEfVkEdsoQ7ke3Dn7kBJPe0,7411
|
|
26
|
+
mwxlib-0.99.5.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
27
|
+
mwxlib-0.99.5.dist-info/top_level.txt,sha256=SI1Mh118AstnUFGPNq5aMNKiAnVNmZk1S9Ij-OwAEpY,4
|
|
28
|
+
mwxlib-0.99.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|