PrEditor 2.1.0__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.
- preditor/__init__.py +315 -0
- preditor/__main__.py +13 -0
- preditor/about_module.py +165 -0
- preditor/cli.py +192 -0
- preditor/config.py +318 -0
- preditor/constants.py +13 -0
- preditor/contexts.py +210 -0
- preditor/cores/__init__.py +0 -0
- preditor/cores/core.py +20 -0
- preditor/dccs/.hab.json +10 -0
- preditor/dccs/maya/PrEditor_maya.mod +1 -0
- preditor/dccs/maya/README.md +22 -0
- preditor/dccs/maya/plug-ins/PrEditor_maya.py +141 -0
- preditor/dccs/studiomax/PackageContents.xml +32 -0
- preditor/dccs/studiomax/PrEditor-PrEditor_Show.mcr +8 -0
- preditor/dccs/studiomax/README.md +17 -0
- preditor/dccs/studiomax/preditor.ms +16 -0
- preditor/dccs/studiomax/preditor_menu.mnx +7 -0
- preditor/debug.py +149 -0
- preditor/delayable_engine/__init__.py +302 -0
- preditor/delayable_engine/delayables.py +85 -0
- preditor/enum.py +728 -0
- preditor/excepthooks.py +165 -0
- preditor/gui/__init__.py +56 -0
- preditor/gui/app.py +163 -0
- preditor/gui/codehighlighter.py +289 -0
- preditor/gui/completer.py +237 -0
- preditor/gui/console.py +605 -0
- preditor/gui/console_base.py +911 -0
- preditor/gui/dialog.py +181 -0
- preditor/gui/drag_tab_bar.py +625 -0
- preditor/gui/editor_chooser.py +57 -0
- preditor/gui/errordialog.py +69 -0
- preditor/gui/find_files.py +137 -0
- preditor/gui/fuzzy_search/__init__.py +0 -0
- preditor/gui/fuzzy_search/fuzzy_search.py +97 -0
- preditor/gui/group_tab_widget/__init__.py +0 -0
- preditor/gui/group_tab_widget/group_tab_widget.py +528 -0
- preditor/gui/group_tab_widget/grouped_tab_menu.py +35 -0
- preditor/gui/group_tab_widget/grouped_tab_models.py +107 -0
- preditor/gui/group_tab_widget/grouped_tab_widget.py +223 -0
- preditor/gui/group_tab_widget/one_tab_widget.py +96 -0
- preditor/gui/level_buttons.py +358 -0
- preditor/gui/logger_window_handler.py +77 -0
- preditor/gui/logger_window_plugin.py +35 -0
- preditor/gui/loggerwindow.py +2405 -0
- preditor/gui/newtabwidget.py +69 -0
- preditor/gui/output_console.py +11 -0
- preditor/gui/qtdesigner/__init__.py +21 -0
- preditor/gui/qtdesigner/_log_plugin.py +29 -0
- preditor/gui/qtdesigner/console_base_plugin.py +48 -0
- preditor/gui/qtdesigner/console_predit_plugin.py +48 -0
- preditor/gui/set_text_editor_path_dialog.py +61 -0
- preditor/gui/status_label.py +99 -0
- preditor/gui/suggest_path_quotes_dialog.py +50 -0
- preditor/gui/ui/editor_chooser.ui +93 -0
- preditor/gui/ui/errordialog.ui +74 -0
- preditor/gui/ui/find_files.ui +140 -0
- preditor/gui/ui/loggerwindow.ui +1909 -0
- preditor/gui/ui/set_text_editor_path_dialog.ui +189 -0
- preditor/gui/ui/suggest_path_quotes_dialog.ui +225 -0
- preditor/gui/window.py +161 -0
- preditor/gui/workbox_mixin.py +1139 -0
- preditor/gui/workbox_text_edit.py +136 -0
- preditor/gui/workboxwidget.py +315 -0
- preditor/logging_config.py +55 -0
- preditor/osystem.py +401 -0
- preditor/plugins.py +118 -0
- preditor/prefs.py +381 -0
- preditor/resource/environment_variables.html +26 -0
- preditor/resource/error_mail.html +85 -0
- preditor/resource/error_mail_inline.html +41 -0
- preditor/resource/img/README.md +17 -0
- preditor/resource/img/arrow_forward.png +0 -0
- preditor/resource/img/check-bold.png +0 -0
- preditor/resource/img/chevron-down.png +0 -0
- preditor/resource/img/chevron-up.png +0 -0
- preditor/resource/img/close-thick.png +0 -0
- preditor/resource/img/comment-edit.png +0 -0
- preditor/resource/img/content-copy.png +0 -0
- preditor/resource/img/content-cut.png +0 -0
- preditor/resource/img/content-duplicate.png +0 -0
- preditor/resource/img/content-paste.png +0 -0
- preditor/resource/img/content-save.png +0 -0
- preditor/resource/img/debug_disabled.png +0 -0
- preditor/resource/img/eye-check.png +0 -0
- preditor/resource/img/file-plus.png +0 -0
- preditor/resource/img/file-remove.png +0 -0
- preditor/resource/img/format-align-left.png +0 -0
- preditor/resource/img/format-letter-case-lower.png +0 -0
- preditor/resource/img/format-letter-case-upper.png +0 -0
- preditor/resource/img/format-letter-case.svg +1 -0
- preditor/resource/img/information.png +0 -0
- preditor/resource/img/logging_critical.png +0 -0
- preditor/resource/img/logging_custom.png +0 -0
- preditor/resource/img/logging_debug.png +0 -0
- preditor/resource/img/logging_error.png +0 -0
- preditor/resource/img/logging_info.png +0 -0
- preditor/resource/img/logging_not_set.png +0 -0
- preditor/resource/img/logging_warning.png +0 -0
- preditor/resource/img/marker.png +0 -0
- preditor/resource/img/play.png +0 -0
- preditor/resource/img/playlist-play.png +0 -0
- preditor/resource/img/plus-minus-variant.png +0 -0
- preditor/resource/img/preditor.ico +0 -0
- preditor/resource/img/preditor.png +0 -0
- preditor/resource/img/preditor.psd +0 -0
- preditor/resource/img/preditor.svg +44 -0
- preditor/resource/img/regex.svg +1 -0
- preditor/resource/img/restart.svg +1 -0
- preditor/resource/img/skip-forward-outline.png +0 -0
- preditor/resource/img/skip-next-outline.png +0 -0
- preditor/resource/img/skip-next.png +0 -0
- preditor/resource/img/skip-previous.png +0 -0
- preditor/resource/img/subdirectory-arrow-right.png +0 -0
- preditor/resource/img/text-search-variant.png +0 -0
- preditor/resource/img/warning-big.png +0 -0
- preditor/resource/lang/python.json +30 -0
- preditor/resource/pref_updates/pref_updates.json +17 -0
- preditor/resource/settings.ini +25 -0
- preditor/resource/stylesheet/Bright.css +76 -0
- preditor/resource/stylesheet/Dark.css +210 -0
- preditor/scintilla/__init__.py +40 -0
- preditor/scintilla/delayables/__init__.py +11 -0
- preditor/scintilla/delayables/smart_highlight.py +97 -0
- preditor/scintilla/delayables/spell_check.py +174 -0
- preditor/scintilla/documenteditor.py +1924 -0
- preditor/scintilla/finddialog.py +68 -0
- preditor/scintilla/lang/__init__.py +80 -0
- preditor/scintilla/lang/config/bash.ini +15 -0
- preditor/scintilla/lang/config/batch.ini +14 -0
- preditor/scintilla/lang/config/cpp.ini +19 -0
- preditor/scintilla/lang/config/css.ini +19 -0
- preditor/scintilla/lang/config/eyeonscript.ini +17 -0
- preditor/scintilla/lang/config/html.ini +21 -0
- preditor/scintilla/lang/config/javascript.ini +24 -0
- preditor/scintilla/lang/config/lua.ini +16 -0
- preditor/scintilla/lang/config/maxscript.ini +20 -0
- preditor/scintilla/lang/config/mel.ini +18 -0
- preditor/scintilla/lang/config/mu.ini +22 -0
- preditor/scintilla/lang/config/nsi.ini +19 -0
- preditor/scintilla/lang/config/perl.ini +19 -0
- preditor/scintilla/lang/config/puppet.ini +19 -0
- preditor/scintilla/lang/config/python.ini +28 -0
- preditor/scintilla/lang/config/ruby.ini +19 -0
- preditor/scintilla/lang/config/sql.ini +7 -0
- preditor/scintilla/lang/config/xml.ini +21 -0
- preditor/scintilla/lang/config/yaml.ini +18 -0
- preditor/scintilla/lang/language.py +240 -0
- preditor/scintilla/lexers/__init__.py +0 -0
- preditor/scintilla/lexers/cpplexer.py +22 -0
- preditor/scintilla/lexers/javascriptlexer.py +27 -0
- preditor/scintilla/lexers/maxscriptlexer.py +235 -0
- preditor/scintilla/lexers/mellexer.py +369 -0
- preditor/scintilla/lexers/mulexer.py +33 -0
- preditor/scintilla/lexers/pythonlexer.py +42 -0
- preditor/scintilla/ui/finddialog.ui +160 -0
- preditor/settings.py +71 -0
- preditor/stream/__init__.py +72 -0
- preditor/stream/console_handler.py +169 -0
- preditor/stream/director.py +144 -0
- preditor/stream/manager.py +97 -0
- preditor/streamhandler_helper.py +46 -0
- preditor/utils/__init__.py +191 -0
- preditor/utils/call_stack.py +86 -0
- preditor/utils/cute.py +106 -0
- preditor/utils/stylesheets.py +54 -0
- preditor/utils/text_search.py +338 -0
- preditor/version.py +34 -0
- preditor/weakref.py +363 -0
- preditor-2.1.0.dist-info/METADATA +308 -0
- preditor-2.1.0.dist-info/RECORD +179 -0
- preditor-2.1.0.dist-info/WHEEL +5 -0
- preditor-2.1.0.dist-info/entry_points.txt +19 -0
- preditor-2.1.0.dist-info/licenses/LICENSE +165 -0
- preditor-2.1.0.dist-info/top_level.txt +3 -0
- tests/encodings/test_ecoding.py +33 -0
- tests/find_files/test_find_files.py +74 -0
- tests/ide/test_delayable_engine.py +171 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
from __future__ import absolute_import
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
|
|
5
|
+
from .. import instance
|
|
6
|
+
from ..constants import StreamType
|
|
7
|
+
from ..stream import Director, Manager
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class LoggerWindowHandler(logging.Handler):
|
|
11
|
+
"""A logging handler that writes directly to the PrEditor instance.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
formatter (str or logging.Formatter, optional): If specified,
|
|
15
|
+
this is passed to setFormatter.
|
|
16
|
+
stream (optional): If provided write to this stream instead of the
|
|
17
|
+
main preditor instance's console.
|
|
18
|
+
stream_type (StreamType, optional): If not None, pass this value to the
|
|
19
|
+
write call's force kwarg.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
default_format = (
|
|
23
|
+
'%(levelname)s %(module)s.%(funcName)s line:%(lineno)d - %(message)s'
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
def __init__(
|
|
27
|
+
self,
|
|
28
|
+
formatter=default_format,
|
|
29
|
+
stream=None,
|
|
30
|
+
stream_type=StreamType.STDERR | StreamType.CONSOLE,
|
|
31
|
+
):
|
|
32
|
+
super(LoggerWindowHandler, self).__init__()
|
|
33
|
+
self.stream_type = stream_type
|
|
34
|
+
self.stream = stream
|
|
35
|
+
self.manager = Manager()
|
|
36
|
+
self.director = Director(self.manager, StreamType.CONSOLE)
|
|
37
|
+
|
|
38
|
+
if formatter is not None:
|
|
39
|
+
if not isinstance(formatter, logging.Formatter):
|
|
40
|
+
formatter = logging.Formatter(formatter)
|
|
41
|
+
self.setFormatter(formatter)
|
|
42
|
+
|
|
43
|
+
def emit(self, record):
|
|
44
|
+
try:
|
|
45
|
+
# If no gui has been created yet, or the `preditor.instance()` was
|
|
46
|
+
# closed and garbage collected, there is nothing to do, simply exit
|
|
47
|
+
stream = self.stream
|
|
48
|
+
if not stream:
|
|
49
|
+
return
|
|
50
|
+
msg = self.format(record)
|
|
51
|
+
kwargs = {}
|
|
52
|
+
if self.stream_type is not None:
|
|
53
|
+
kwargs["stream_type"] = self.stream_type
|
|
54
|
+
stream.write(f'{msg}\n', **kwargs)
|
|
55
|
+
except (KeyboardInterrupt, SystemExit):
|
|
56
|
+
raise
|
|
57
|
+
except Exception:
|
|
58
|
+
self.handleError(record)
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def stream(self):
|
|
62
|
+
"""The stream to write log messages to.
|
|
63
|
+
|
|
64
|
+
If no stream is set then it returns `preditor.instance().console()`.
|
|
65
|
+
"""
|
|
66
|
+
if self._stream is not None:
|
|
67
|
+
return self._stream
|
|
68
|
+
|
|
69
|
+
_instance = instance(create=False)
|
|
70
|
+
if _instance is None:
|
|
71
|
+
return None
|
|
72
|
+
# Note: This does not handle if the instance has been closed
|
|
73
|
+
return _instance.console()
|
|
74
|
+
|
|
75
|
+
@stream.setter
|
|
76
|
+
def stream(self, stream):
|
|
77
|
+
self._stream = stream
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
class LoggerWindowPlugin:
|
|
2
|
+
"""Base class for LoggerWindow plugins.
|
|
3
|
+
|
|
4
|
+
These plugins are loaded using the `preditor.plug.loggerwindow` entry point.
|
|
5
|
+
This entry point is loaded when `LoggerWindow` is initialized. For each entry
|
|
6
|
+
point defined a single instance of the plugin is created per instance of
|
|
7
|
+
a LoggerWindow.
|
|
8
|
+
|
|
9
|
+
To save preferences override `record_prefs` and `restore_prefs` methods. These
|
|
10
|
+
are used to save and load preferences any time the PrEditor save/loads prefs.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, parent):
|
|
14
|
+
self.parent = parent
|
|
15
|
+
|
|
16
|
+
def updateWindowTitle(self, title):
|
|
17
|
+
return title
|
|
18
|
+
|
|
19
|
+
def record_prefs(self, name):
|
|
20
|
+
"""Returns any prefs to save with the PrEditor's preferences.
|
|
21
|
+
|
|
22
|
+
Returns:
|
|
23
|
+
dict: A dictionary that will be saved using json or None.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
def restore_prefs(self, name, prefs):
|
|
27
|
+
"""Restore the preferences saved from a previous launch.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
name(str): The name specified by the `preditor.plug.loggerwindow`
|
|
31
|
+
entry point.
|
|
32
|
+
prefs(dict or None): The prefs returned by a previous call to
|
|
33
|
+
`record_prefs()` from the last preference save. None is passed
|
|
34
|
+
if no prefs were recorded.
|
|
35
|
+
"""
|