PrEditor 0.0.0.dev1__py2.py3-none-any.whl → 0.1.0__py2.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 PrEditor might be problematic. Click here for more details.
- PrEditor-0.1.0.dist-info/LICENSE +165 -0
- PrEditor-0.1.0.dist-info/METADATA +212 -0
- PrEditor-0.1.0.dist-info/RECORD +149 -0
- {PrEditor-0.0.0.dev1.dist-info → PrEditor-0.1.0.dist-info}/WHEEL +1 -1
- PrEditor-0.1.0.dist-info/entry_points.txt +18 -0
- PrEditor-0.1.0.dist-info/top_level.txt +1 -0
- preditor/__init__.py +301 -0
- {blurdev → preditor}/__main__.py +13 -13
- preditor/about_module.py +166 -0
- preditor/cli.py +192 -0
- {blurdev → preditor}/contexts.py +119 -119
- preditor/cores/core.py +65 -0
- preditor/dccs/maya/PrEditor_maya.mod +2 -0
- preditor/dccs/maya/plug-ins/PrEditor_maya.py +108 -0
- preditor/debug.py +294 -0
- blurdev/scintilla/delayable_engine.py → preditor/delayable_engine/__init__.py +310 -299
- blurdev/scintilla/delayables/base.py → preditor/delayable_engine/delayables.py +85 -85
- {blurdev → preditor}/enum.py +728 -1003
- {blurdev → preditor}/gui/__init__.py +84 -125
- preditor/gui/app.py +159 -0
- {blurdev → preditor}/gui/codehighlighter.py +209 -219
- {blurdev → preditor}/gui/completer.py +226 -236
- {blurdev → preditor}/gui/console.py +801 -858
- {blurdev → preditor}/gui/dialog.py +200 -216
- preditor/gui/drag_tab_bar.py +190 -0
- preditor/gui/editor_chooser.py +57 -0
- {blurdev → preditor}/gui/errordialog.py +100 -97
- preditor/gui/fuzzy_search/fuzzy_search.py +93 -0
- preditor/gui/group_tab_widget/__init__.py +319 -0
- preditor/gui/group_tab_widget/grouped_tab_menu.py +35 -0
- preditor/gui/group_tab_widget/grouped_tab_models.py +108 -0
- preditor/gui/group_tab_widget/grouped_tab_widget.py +75 -0
- preditor/gui/group_tab_widget/one_tab_widget.py +54 -0
- preditor/gui/level_buttons.py +349 -0
- {blurdev → preditor}/gui/logger_window_handler.py +46 -45
- {blurdev → preditor}/gui/loggerwindow.py +1205 -1417
- {blurdev → preditor}/gui/newtabwidget.py +69 -68
- {blurdev → preditor}/gui/redmine_login_dialog.py +63 -61
- {blurdev → preditor}/gui/set_text_editor_path_dialog.py +59 -57
- preditor/gui/ui/editor_chooser.ui +93 -0
- {blurdev → preditor}/gui/ui/errordialog.ui +81 -81
- {blurdev → preditor}/gui/ui/loggerwindow.ui +1030 -864
- {blurdev → preditor}/gui/ui/redmine_login_dialog.ui +124 -124
- {blurdev → preditor}/gui/ui/set_text_editor_path_dialog.ui +149 -149
- {blurdev → preditor}/gui/window.py +183 -199
- preditor/gui/workbox_mixin.py +357 -0
- preditor/gui/workbox_text_edit.py +117 -0
- preditor/gui/workboxwidget.py +276 -0
- preditor/logging_config.py +52 -0
- preditor/osystem.py +401 -0
- preditor/plugins.py +65 -0
- preditor/prefs.py +74 -0
- {blurdev → preditor}/resource/environment_variables.html +26 -38
- {blurdev → preditor}/resource/error_mail.html +85 -85
- {blurdev → preditor}/resource/error_mail_inline.html +41 -41
- preditor/resource/img/README.md +7 -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/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/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
- {blurdev → preditor}/resource/lang/python.json +30 -30
- preditor/resource/settings.ini +25 -0
- {blurdev/resource/stylesheet/logger → preditor/resource/stylesheet}/Bright.css +56 -61
- {blurdev → preditor}/resource/stylesheet/Dark.css +190 -132
- {blurdev → preditor}/scintilla/__init__.py +22 -28
- preditor/scintilla/delayables/__init__.py +11 -0
- {blurdev → preditor}/scintilla/delayables/smart_highlight.py +94 -93
- {blurdev → preditor}/scintilla/delayables/spell_check.py +173 -172
- {blurdev → preditor}/scintilla/documenteditor.py +2039 -2115
- {blurdev → preditor}/scintilla/finddialog.py +68 -81
- {blurdev → preditor}/scintilla/lang/__init__.py +80 -93
- {blurdev → preditor}/scintilla/lang/config/bash.ini +15 -15
- {blurdev → preditor}/scintilla/lang/config/batch.ini +14 -14
- {blurdev → preditor}/scintilla/lang/config/cpp.ini +19 -19
- {blurdev → preditor}/scintilla/lang/config/css.ini +19 -19
- {blurdev → preditor}/scintilla/lang/config/eyeonscript.ini +17 -17
- {blurdev → preditor}/scintilla/lang/config/html.ini +21 -21
- {blurdev → preditor}/scintilla/lang/config/javascript.ini +24 -24
- {blurdev → preditor}/scintilla/lang/config/lua.ini +16 -16
- {blurdev → preditor}/scintilla/lang/config/maxscript.ini +20 -20
- {blurdev → preditor}/scintilla/lang/config/mel.ini +18 -18
- {blurdev → preditor}/scintilla/lang/config/mu.ini +22 -22
- {blurdev → preditor}/scintilla/lang/config/nsi.ini +5 -5
- {blurdev → preditor}/scintilla/lang/config/perl.ini +19 -19
- {blurdev → preditor}/scintilla/lang/config/puppet.ini +19 -19
- {blurdev → preditor}/scintilla/lang/config/python.ini +28 -28
- {blurdev → preditor}/scintilla/lang/config/ruby.ini +19 -19
- {blurdev → preditor}/scintilla/lang/config/sql.ini +7 -7
- {blurdev → preditor}/scintilla/lang/config/xml.ini +21 -21
- {blurdev → preditor}/scintilla/lang/config/yaml.ini +18 -18
- {blurdev → preditor}/scintilla/lang/language.py +240 -250
- preditor/scintilla/lexers/__init__.py +0 -0
- {blurdev → preditor}/scintilla/lexers/cpplexer.py +21 -30
- {blurdev → preditor}/scintilla/lexers/javascriptlexer.py +25 -34
- {blurdev → preditor}/scintilla/lexers/maxscriptlexer.py +234 -253
- {blurdev → preditor}/scintilla/lexers/mellexer.py +368 -376
- {blurdev → preditor}/scintilla/lexers/mulexer.py +32 -41
- {blurdev → preditor}/scintilla/lexers/pythonlexer.py +41 -50
- {blurdev → preditor}/scintilla/ui/finddialog.ui +160 -160
- preditor/settings.py +71 -0
- preditor/stream/__init__.py +80 -0
- preditor/stream/director.py +56 -0
- preditor/stream/manager.py +74 -0
- preditor/streamhandler_helper.py +46 -0
- preditor/utils/__init__.py +0 -0
- preditor/utils/cute.py +30 -0
- preditor/utils/stylesheets.py +54 -0
- {blurdev → preditor}/version.py +5 -5
- preditor/weakref.py +363 -0
- PrEditor-0.0.0.dev1.dist-info/METADATA +0 -51
- PrEditor-0.0.0.dev1.dist-info/RECORD +0 -279
- PrEditor-0.0.0.dev1.dist-info/top_level.txt +0 -1
- blurdev/__init__.py +0 -356
- blurdev/cores/__init__.py +0 -98
- blurdev/cores/application.py +0 -26
- blurdev/cores/core.py +0 -634
- blurdev/debug.py +0 -593
- blurdev/external.py +0 -391
- blurdev/gui/level_buttons.py +0 -585
- blurdev/gui/workboxwidget.py +0 -205
- blurdev/logger.py +0 -238
- blurdev/osystem.py +0 -813
- blurdev/prefs.py +0 -33
- blurdev/protocols/__init__.py +0 -71
- blurdev/protocols/write_std_output_handler.py +0 -83
- blurdev/resource/designer_plugins.xml +0 -9
- blurdev/resource/error_email_old.html +0 -41
- blurdev/resource/img/add.png +0 -0
- blurdev/resource/img/ajax-loader.gif +0 -0
- blurdev/resource/img/application.png +0 -0
- blurdev/resource/img/applications.png +0 -0
- blurdev/resource/img/assburner.png +0 -0
- blurdev/resource/img/assfreezer.png +0 -0
- blurdev/resource/img/bar.gif +0 -0
- blurdev/resource/img/blank.png +0 -0
- blurdev/resource/img/blurdev.png +0 -0
- blurdev/resource/img/calendar_disabled.png +0 -0
- blurdev/resource/img/calendar_enabled.png +0 -0
- blurdev/resource/img/cancel.png +0 -0
- blurdev/resource/img/custom.png +0 -0
- blurdev/resource/img/debug_high.png +0 -0
- blurdev/resource/img/debug_low.png +0 -0
- blurdev/resource/img/debug_mid.png +0 -0
- blurdev/resource/img/debug_off.png +0 -0
- blurdev/resource/img/django.png +0 -0
- blurdev/resource/img/doc.png +0 -0
- blurdev/resource/img/edit.png +0 -0
- blurdev/resource/img/elemental.png +0 -0
- blurdev/resource/img/explore.png +0 -0
- blurdev/resource/img/favorite.png +0 -0
- blurdev/resource/img/file.png +0 -0
- blurdev/resource/img/folder.png +0 -0
- blurdev/resource/img/ide/add.png +0 -0
- blurdev/resource/img/ide/add_note.png +0 -0
- blurdev/resource/img/ide/arrow_down.png +0 -0
- blurdev/resource/img/ide/arrow_up.png +0 -0
- blurdev/resource/img/ide/check.png +0 -0
- blurdev/resource/img/ide/class.png +0 -0
- blurdev/resource/img/ide/clean.png +0 -0
- blurdev/resource/img/ide/clearlog.png +0 -0
- blurdev/resource/img/ide/close.png +0 -0
- blurdev/resource/img/ide/comment_add.png +0 -0
- blurdev/resource/img/ide/comment_remove.png +0 -0
- blurdev/resource/img/ide/comment_toggle.png +0 -0
- blurdev/resource/img/ide/console.png +0 -0
- blurdev/resource/img/ide/copy.png +0 -0
- blurdev/resource/img/ide/copylstrip.png +0 -0
- blurdev/resource/img/ide/cut.png +0 -0
- blurdev/resource/img/ide/edit.png +0 -0
- blurdev/resource/img/ide/find.png +0 -0
- blurdev/resource/img/ide/find_replace.png +0 -0
- blurdev/resource/img/ide/findnext.png +0 -0
- blurdev/resource/img/ide/findprev.png +0 -0
- blurdev/resource/img/ide/folder_find.png +0 -0
- blurdev/resource/img/ide/function.png +0 -0
- blurdev/resource/img/ide/git-bash.png +0 -0
- blurdev/resource/img/ide/git-gui.png +0 -0
- blurdev/resource/img/ide/gitk.png +0 -0
- blurdev/resource/img/ide/goto.png +0 -0
- blurdev/resource/img/ide/goto_def.png +0 -0
- blurdev/resource/img/ide/help.png +0 -0
- blurdev/resource/img/ide/highlighter.png +0 -0
- blurdev/resource/img/ide/lowercase.png +0 -0
- blurdev/resource/img/ide/newfile.png +0 -0
- blurdev/resource/img/ide/newfolder.png +0 -0
- blurdev/resource/img/ide/newproject.png +0 -0
- blurdev/resource/img/ide/newwizard.png +0 -0
- blurdev/resource/img/ide/open.png +0 -0
- blurdev/resource/img/ide/paste.png +0 -0
- blurdev/resource/img/ide/pdb_continue.png +0 -0
- blurdev/resource/img/ide/pdb_down.png +0 -0
- blurdev/resource/img/ide/pdb_next.png +0 -0
- blurdev/resource/img/ide/pdb_step.png +0 -0
- blurdev/resource/img/ide/pdb_up.png +0 -0
- blurdev/resource/img/ide/plus_minus.png +0 -0
- blurdev/resource/img/ide/preferences.png +0 -0
- blurdev/resource/img/ide/project_find.png +0 -0
- blurdev/resource/img/ide/python.png +0 -0
- blurdev/resource/img/ide/pyular.png +0 -0
- blurdev/resource/img/ide/qt.png +0 -0
- blurdev/resource/img/ide/quit.png +0 -0
- blurdev/resource/img/ide/redo.png +0 -0
- blurdev/resource/img/ide/refresh.png +0 -0
- blurdev/resource/img/ide/remove.png +0 -0
- blurdev/resource/img/ide/ruler.png +0 -0
- blurdev/resource/img/ide/run.png +0 -0
- blurdev/resource/img/ide/runall.png +0 -0
- blurdev/resource/img/ide/runallclear.png +0 -0
- blurdev/resource/img/ide/runselected.png +0 -0
- blurdev/resource/img/ide/runselectedclear.png +0 -0
- blurdev/resource/img/ide/save.png +0 -0
- blurdev/resource/img/ide/saveas.png +0 -0
- blurdev/resource/img/ide/sdk.png +0 -0
- blurdev/resource/img/ide/separator.png +0 -0
- blurdev/resource/img/ide/tabbed.png +0 -0
- blurdev/resource/img/ide/tile.png +0 -0
- blurdev/resource/img/ide/toolbar.png +0 -0
- blurdev/resource/img/ide/undo.png +0 -0
- blurdev/resource/img/ide/uppercase.png +0 -0
- blurdev/resource/img/ide/view_as.png +0 -0
- blurdev/resource/img/ide/windowed.png +0 -0
- blurdev/resource/img/ide.ico +0 -0
- blurdev/resource/img/ide.png +0 -0
- blurdev/resource/img/ide48.png +0 -0
- blurdev/resource/img/info.png +0 -0
- blurdev/resource/img/legacy tool.png +0 -0
- blurdev/resource/img/library.png +0 -0
- blurdev/resource/img/logger/about.png +0 -0
- blurdev/resource/img/logger/arrow_forward.png +0 -0
- blurdev/resource/img/logger/clear.png +0 -0
- blurdev/resource/img/logger/close.png +0 -0
- blurdev/resource/img/logger/debug_disabled.png +0 -0
- blurdev/resource/img/logger/debug_high.png +0 -0
- blurdev/resource/img/logger/debug_low.png +0 -0
- blurdev/resource/img/logger/debug_mid.png +0 -0
- blurdev/resource/img/logger/down.png +0 -0
- blurdev/resource/img/logger/find.png +0 -0
- blurdev/resource/img/logger/logging_critical.png +0 -0
- blurdev/resource/img/logger/logging_debug.png +0 -0
- blurdev/resource/img/logger/logging_error.png +0 -0
- blurdev/resource/img/logger/logging_info.png +0 -0
- blurdev/resource/img/logger/logging_not_set.png +0 -0
- blurdev/resource/img/logger/logging_warning.png +0 -0
- blurdev/resource/img/logger/next.png +0 -0
- blurdev/resource/img/logger/play.png +0 -0
- blurdev/resource/img/logger/playlist_play.png +0 -0
- blurdev/resource/img/logger/previous.png +0 -0
- blurdev/resource/img/logger/return.png +0 -0
- blurdev/resource/img/logger/save.png +0 -0
- blurdev/resource/img/logger/subdirectory_arrow_right.png +0 -0
- blurdev/resource/img/logger/up.png +0 -0
- blurdev/resource/img/lovebar.png +0 -0
- blurdev/resource/img/new.png +0 -0
- blurdev/resource/img/new_selected.png +0 -0
- blurdev/resource/img/node.png +0 -0
- blurdev/resource/img/ok.png +0 -0
- blurdev/resource/img/options.png +0 -0
- blurdev/resource/img/packages.png +0 -0
- blurdev/resource/img/preview/add.png +0 -0
- blurdev/resource/img/preview/brush.png +0 -0
- blurdev/resource/img/preview/delete.png +0 -0
- blurdev/resource/img/preview/delte.png +0 -0
- blurdev/resource/img/preview/fill.png +0 -0
- blurdev/resource/img/preview/layers.png +0 -0
- blurdev/resource/img/preview/media.png +0 -0
- blurdev/resource/img/preview/navigate.png +0 -0
- blurdev/resource/img/preview/pencil.png +0 -0
- blurdev/resource/img/preview/select.png +0 -0
- blurdev/resource/img/preview/type.png +0 -0
- blurdev/resource/img/preview/visible.png +0 -0
- blurdev/resource/img/project.png +0 -0
- blurdev/resource/img/python_logger.ico +0 -0
- blurdev/resource/img/python_logger.png +0 -0
- blurdev/resource/img/refresh.png +0 -0
- blurdev/resource/img/remove.png +0 -0
- blurdev/resource/img/reset.png +0 -0
- blurdev/resource/img/richtext/font_bold.png +0 -0
- blurdev/resource/img/richtext/font_italic.png +0 -0
- blurdev/resource/img/richtext/link_image.png +0 -0
- blurdev/resource/img/richtext/spell_check.png +0 -0
- blurdev/resource/img/richtext/unordered_list.png +0 -0
- blurdev/resource/img/save.png +0 -0
- blurdev/resource/img/savesettings.png +0 -0
- blurdev/resource/img/settings.png +0 -0
- blurdev/resource/img/tool.png +0 -0
- blurdev/resource/img/toolbarHandleHorizontal.png +0 -0
- blurdev/resource/img/toolbarHandleVertical.png +0 -0
- blurdev/resource/img/trash.png +0 -0
- blurdev/resource/img/trax.png +0 -0
- blurdev/resource/img/tree.png +0 -0
- blurdev/resource/img/treegrunt.ico +0 -0
- blurdev/resource/img/treegrunt.png +0 -0
- blurdev/resource/img/treegruntedit.png +0 -0
- blurdev/resource/img/user interface.png +0 -0
- blurdev/resource/img/warning.png +0 -0
- blurdev/resource/img/watermark.png +0 -0
- blurdev/resource/sdk/blurdev.sdk +0 -3
- blurdev/resource/settings.ini +0 -82
- blurdev/resource/softimage/BlurApplication.dll +0 -0
- blurdev/resource/softimage/BlurApplication64.dll +0 -0
- blurdev/resource/stylesheet/Carbon.css +0 -35
- blurdev/resource/stylesheet/logger/Dark.css +0 -62
- blurdev/resource/templ/py_comment.templ +0 -1
- blurdev/resource/templ/py_debug_raise_error.templ +0 -7
- blurdev/resource/templ/py_doc_string.templ +0 -10
- blurdev/resource/templ/py_header.templ +0 -9
- blurdev/resource/templ/py_line_comment.templ +0 -1
- blurdev/resource/templ/py_log_to_file.templ +0 -22
- blurdev/resource/templ/py_module_path.templ +0 -1
- blurdev/resource/templ/py_pyqt_core.templ +0 -1
- blurdev/resource/templ/py_pyqt_gui.templ +0 -1
- blurdev/resource/templ/py_splashscreen.templ +0 -6
- blurdev/resource/templ/py_testing_note.templ +0 -1
- blurdev/resource/templ/py_testing_note_end.templ +0 -1
- blurdev/resource/tools_environments.json +0 -72
- blurdev/resource/tools_environments.xml +0 -11
- blurdev/resource/tools_environments_linux.xml +0 -11
- blurdev/resource/tools_environments_offline.xml +0 -7
- blurdev/runtimes/__init__.py +0 -2
- blurdev/runtimes/logger.py +0 -44
- blurdev/scintilla/delayables/__init__.py +0 -9
- blurdev/settings.py +0 -312
- blurdev/utils/error.py +0 -389
- {blurdev/scintilla/lexers → preditor/cores}/__init__.py +0 -0
- {blurdev/utils → preditor/gui/fuzzy_search}/__init__.py +0 -0
- {blurdev → preditor}/resource/img/warning-big.png +0 -0
blurdev/gui/workboxwidget.py
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
##
|
|
2
|
-
# \namespace python.blurdev.gui.loggerwindow.workboxwidget
|
|
3
|
-
#
|
|
4
|
-
# \remarks A area to save and run code past the existing session
|
|
5
|
-
#
|
|
6
|
-
# \author beta@blur.com
|
|
7
|
-
# \author Blur Studio
|
|
8
|
-
# \date 03/17/11
|
|
9
|
-
#
|
|
10
|
-
from __future__ import print_function
|
|
11
|
-
from __future__ import absolute_import
|
|
12
|
-
import re
|
|
13
|
-
import blurdev
|
|
14
|
-
|
|
15
|
-
from Qt.QtCore import Qt
|
|
16
|
-
from Qt.QtGui import QIcon
|
|
17
|
-
from Qt.QtWidgets import QAction
|
|
18
|
-
from ..scintilla.documenteditor import DocumentEditor
|
|
19
|
-
from ..scintilla.finddialog import FindDialog
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class WorkboxWidget(DocumentEditor):
|
|
23
|
-
def __init__(self, parent, console=None, delayable_engine='default'):
|
|
24
|
-
self._console = console
|
|
25
|
-
self._searchFlags = 0
|
|
26
|
-
self._searchText = ''
|
|
27
|
-
self._searchDialog = None
|
|
28
|
-
|
|
29
|
-
# initialize the super class
|
|
30
|
-
super(WorkboxWidget, self).__init__(parent, delayable_engine=delayable_engine)
|
|
31
|
-
|
|
32
|
-
# Store the software name so we can handle custom keyboard shortcuts bassed on
|
|
33
|
-
# software
|
|
34
|
-
self._software = blurdev.core.objectName()
|
|
35
|
-
self.regex = re.compile(r'\s+$')
|
|
36
|
-
self.initShortcuts()
|
|
37
|
-
|
|
38
|
-
def console(self):
|
|
39
|
-
return self._console
|
|
40
|
-
|
|
41
|
-
def execAll(self):
|
|
42
|
-
"""re-implement the DocumentEditor.exec_ method to run this code without saving"""
|
|
43
|
-
txt = self.toUnixLineEndings(self.text()).rstrip()
|
|
44
|
-
idx = self.parent().indexOf(self)
|
|
45
|
-
filename = '<WorkboxWidget>:{}'.format(idx)
|
|
46
|
-
self.console().executeString(txt, filename=filename)
|
|
47
|
-
|
|
48
|
-
def execSelected(self):
|
|
49
|
-
# Get the first line number of the selection so we can report correct line
|
|
50
|
-
# numbers. If text is selected use it, otherwise use the text of the current
|
|
51
|
-
# line.
|
|
52
|
-
txt = self.selectedText()
|
|
53
|
-
if txt:
|
|
54
|
-
line, s, end, e = self.getSelection()
|
|
55
|
-
else:
|
|
56
|
-
line, index = self.getCursorPosition()
|
|
57
|
-
txt = self.text(line)
|
|
58
|
-
|
|
59
|
-
# Get rid of pesky \r's
|
|
60
|
-
txt = self.toUnixLineEndings(txt)
|
|
61
|
-
|
|
62
|
-
stripCommon = True
|
|
63
|
-
if stripCommon:
|
|
64
|
-
lines = txt.split('\n')
|
|
65
|
-
rep = self.findLeadingWhitespace(lines)
|
|
66
|
-
if rep:
|
|
67
|
-
lines = self.stripLeadingWhitespace(lines, rep)
|
|
68
|
-
txt = u'\n'.join(lines)
|
|
69
|
-
|
|
70
|
-
# Make workbox line numbers match the workbox line numbers.
|
|
71
|
-
txt = '\n' * line + txt
|
|
72
|
-
|
|
73
|
-
# execute the code
|
|
74
|
-
idx = self.parent().indexOf(self)
|
|
75
|
-
filename = '<WorkboxSelection>:{}'.format(idx)
|
|
76
|
-
ret, wasEval = self.console().executeString(txt, filename=filename)
|
|
77
|
-
if wasEval:
|
|
78
|
-
# If the selected code was a statement print the result of the statement.
|
|
79
|
-
ret = repr(ret)
|
|
80
|
-
self.console().startOutputLine()
|
|
81
|
-
print(self.truncate_middle(ret, 100))
|
|
82
|
-
|
|
83
|
-
def findLeadingWhitespace(self, lines):
|
|
84
|
-
# Find the first line that has text that isn't a comment
|
|
85
|
-
# We will then remove the leading whitespace from that line
|
|
86
|
-
# from all subsequent lines
|
|
87
|
-
for s in lines:
|
|
88
|
-
m = re.match(r'(\s*)([^#])', s)
|
|
89
|
-
# Only use leading whitespace if the match has text
|
|
90
|
-
if m and m.group(2).strip():
|
|
91
|
-
return m.group(1)
|
|
92
|
-
return ''
|
|
93
|
-
|
|
94
|
-
def stripLeadingWhitespace(self, lines, rep):
|
|
95
|
-
newLines = []
|
|
96
|
-
for line in lines:
|
|
97
|
-
if not line:
|
|
98
|
-
newLines.append(line)
|
|
99
|
-
continue
|
|
100
|
-
|
|
101
|
-
if line.startswith(rep):
|
|
102
|
-
nl = line.replace(rep, '', 1)
|
|
103
|
-
newLines.append(nl)
|
|
104
|
-
else:
|
|
105
|
-
raise IndentationError("Prefix Stripping Failed")
|
|
106
|
-
return newLines
|
|
107
|
-
|
|
108
|
-
def truncate_middle(self, s, n, sep=' ... '):
|
|
109
|
-
# https://www.xormedia.com/string-truncate-middle-with-ellipsis/
|
|
110
|
-
if len(s) <= n:
|
|
111
|
-
# string is already short-enough
|
|
112
|
-
return s
|
|
113
|
-
# half of the size, minus the seperator
|
|
114
|
-
n_2 = int(n) / 2 - len(sep)
|
|
115
|
-
# whatever's left
|
|
116
|
-
n_1 = n - n_2 - len(sep)
|
|
117
|
-
return '{0}{1}{2}'.format(s[:n_1], sep, s[-n_2:])
|
|
118
|
-
|
|
119
|
-
def keyPressEvent(self, event):
|
|
120
|
-
if self._software == 'softimage':
|
|
121
|
-
DocumentEditor.keyPressEvent(self, event)
|
|
122
|
-
else:
|
|
123
|
-
if event.key() == Qt.Key_Enter or (
|
|
124
|
-
event.key() == Qt.Key_Return and event.modifiers() == Qt.ShiftModifier
|
|
125
|
-
):
|
|
126
|
-
self.execSelected()
|
|
127
|
-
|
|
128
|
-
if self.window().uiAutoPromptACT.isChecked():
|
|
129
|
-
self.console().startInputLine()
|
|
130
|
-
else:
|
|
131
|
-
DocumentEditor.keyPressEvent(self, event)
|
|
132
|
-
|
|
133
|
-
def initShortcuts(self):
|
|
134
|
-
"""Use this to set up shortcuts when the DocumentEditor"""
|
|
135
|
-
icon = QIcon(blurdev.resourcePath('img/logger/find.png'))
|
|
136
|
-
self.uiFindACT = QAction(icon, 'Find...', self)
|
|
137
|
-
self.uiFindACT.setShortcut("Ctrl+F")
|
|
138
|
-
self.addAction(self.uiFindACT)
|
|
139
|
-
|
|
140
|
-
icon = QIcon(blurdev.resourcePath('img/logger/previous.png'))
|
|
141
|
-
self.uiFindPrevACT = QAction(icon, 'Find Prev', self)
|
|
142
|
-
self.uiFindPrevACT.setShortcut("Ctrl+F3")
|
|
143
|
-
self.addAction(self.uiFindPrevACT)
|
|
144
|
-
|
|
145
|
-
icon = QIcon(blurdev.resourcePath('img/logger/next.png'))
|
|
146
|
-
self.uiFindNextACT = QAction(icon, 'Find Next', self)
|
|
147
|
-
self.uiFindNextACT.setShortcut("F3")
|
|
148
|
-
self.addAction(self.uiFindNextACT)
|
|
149
|
-
|
|
150
|
-
self.uiSelectCurrentLineACT = QAction(icon, 'Select Line', self)
|
|
151
|
-
self.uiSelectCurrentLineACT.triggered.connect(self.expandCursorToLineSelection)
|
|
152
|
-
self.uiSelectCurrentLineACT.setShortcut('Ctrl+L')
|
|
153
|
-
self.addAction(self.uiSelectCurrentLineACT)
|
|
154
|
-
|
|
155
|
-
# create the search dialog and connect actions
|
|
156
|
-
self._searchDialog = FindDialog(self)
|
|
157
|
-
self._searchDialog.setAttribute(Qt.WA_DeleteOnClose, False)
|
|
158
|
-
self.uiFindACT.triggered.connect(
|
|
159
|
-
lambda: self._searchDialog.search(self.searchText())
|
|
160
|
-
)
|
|
161
|
-
self.uiFindPrevACT.triggered.connect(
|
|
162
|
-
lambda: self.findPrev(self.searchText(), self.searchFlags())
|
|
163
|
-
)
|
|
164
|
-
self.uiFindNextACT.triggered.connect(
|
|
165
|
-
lambda: self.findNext(self.searchText(), self.searchFlags())
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
def searchFlags(self):
|
|
169
|
-
return self._searchFlags
|
|
170
|
-
|
|
171
|
-
def searchText(self):
|
|
172
|
-
if not self._searchDialog:
|
|
173
|
-
return ''
|
|
174
|
-
# refresh the search text unless we are using regular expressions
|
|
175
|
-
if (
|
|
176
|
-
not self._searchDialog.isVisible()
|
|
177
|
-
and not self._searchFlags & self.SearchOptions.QRegExp
|
|
178
|
-
):
|
|
179
|
-
txt = self.selectedText()
|
|
180
|
-
if txt:
|
|
181
|
-
self._searchText = txt
|
|
182
|
-
return self._searchText
|
|
183
|
-
|
|
184
|
-
def selectedText(self):
|
|
185
|
-
return self.regex.split(super(WorkboxWidget, self).selectedText())[0]
|
|
186
|
-
|
|
187
|
-
def setConsole(self, console):
|
|
188
|
-
self._console = console
|
|
189
|
-
|
|
190
|
-
def setSearchFlags(self, flags):
|
|
191
|
-
self._searchFlags = flags
|
|
192
|
-
|
|
193
|
-
def setSearchText(self, txt):
|
|
194
|
-
self._searchText = txt
|
|
195
|
-
|
|
196
|
-
def setWorkboxFont(self, font):
|
|
197
|
-
if self.lexer():
|
|
198
|
-
self.lexer().setFont(font)
|
|
199
|
-
else:
|
|
200
|
-
self.setFont(font)
|
|
201
|
-
|
|
202
|
-
@classmethod
|
|
203
|
-
def toUnixLineEndings(cls, txt):
|
|
204
|
-
"""Replaces all windows and then mac line endings with unix line endings."""
|
|
205
|
-
return txt.replace('\r\n', '\n').replace('\r', '\n')
|
blurdev/logger.py
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
# standard library imports
|
|
2
|
-
from __future__ import absolute_import
|
|
3
|
-
import json
|
|
4
|
-
import logging
|
|
5
|
-
import os
|
|
6
|
-
import shutil
|
|
7
|
-
import sys
|
|
8
|
-
|
|
9
|
-
# third-party imports
|
|
10
|
-
from signalslot import Signal
|
|
11
|
-
|
|
12
|
-
# blur imports
|
|
13
|
-
from blurdev.prefs import prefs_path
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
CORE_MAPPINGS = {
|
|
17
|
-
"fusion": ["fusion"],
|
|
18
|
-
"houdini": ["hmaster", "hython", "houdini", "hescape"],
|
|
19
|
-
"katana": ["katana"],
|
|
20
|
-
"mari": ["mari"],
|
|
21
|
-
"maya": ["maya"],
|
|
22
|
-
"motionbuilder": ["motionbuilder"],
|
|
23
|
-
"nuke": ["nuke"],
|
|
24
|
-
"rv": ["rv"],
|
|
25
|
-
"softimage": ["xsi"],
|
|
26
|
-
"studiomax": ["max"],
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
core_name = ""
|
|
30
|
-
logger_config = {}
|
|
31
|
-
logger_patched = False
|
|
32
|
-
Logger = logging.getLoggerClass()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class LoggerWithSignals(Logger):
|
|
36
|
-
|
|
37
|
-
"""
|
|
38
|
-
An override of the standard library's `logging.Logger`-class, providing
|
|
39
|
-
signal events for creation of a new logger instance and the change of
|
|
40
|
-
a logger's level.
|
|
41
|
-
|
|
42
|
-
Signals:
|
|
43
|
-
level_changed (int): An instance-level signal denoting the level has
|
|
44
|
-
changed for the logger the signal was emitted from. The numeric
|
|
45
|
-
level value is passed-along with the signal as the arg `level`.
|
|
46
|
-
logger_created (LoggerWithSignals): A class-level signal denoting the
|
|
47
|
-
instantiation of a new logger of this class. The newly created
|
|
48
|
-
logger is passed-along with the signal as the arg `logger`.
|
|
49
|
-
"""
|
|
50
|
-
|
|
51
|
-
# class-level signal
|
|
52
|
-
logger_created = Signal(args=["logger"], name="logger_created")
|
|
53
|
-
|
|
54
|
-
# instance-level signal
|
|
55
|
-
level_changed = None
|
|
56
|
-
|
|
57
|
-
def __init__(self, name):
|
|
58
|
-
"""
|
|
59
|
-
Creates the logger and loads the previous level it was set to based off
|
|
60
|
-
the current core's saved configuration.
|
|
61
|
-
|
|
62
|
-
After initialization the `logger_created`-signal is emitted with this
|
|
63
|
-
logger object as its payload.
|
|
64
|
-
|
|
65
|
-
Also instantiates the instance-level signal `level_changed`.
|
|
66
|
-
|
|
67
|
-
Args:
|
|
68
|
-
name (str): Logger name.
|
|
69
|
-
"""
|
|
70
|
-
self.level_changed = Signal(args=["level"], name="level_changed")
|
|
71
|
-
super(LoggerWithSignals, self).__init__(name)
|
|
72
|
-
|
|
73
|
-
# restore logger config from core's previous session
|
|
74
|
-
level = getLoggerConfiguration(name)
|
|
75
|
-
if level >= 0:
|
|
76
|
-
self.setLevel(level)
|
|
77
|
-
|
|
78
|
-
# emit creation signal
|
|
79
|
-
self.logger_created.emit(logger=self)
|
|
80
|
-
|
|
81
|
-
def setLevel(self, level):
|
|
82
|
-
"""
|
|
83
|
-
Sets the threshold for this logger to `level`. Also emits the
|
|
84
|
-
instance's `level_changed`-signal with the level number as its payload.
|
|
85
|
-
|
|
86
|
-
Args:
|
|
87
|
-
level (int): Numeric level value.
|
|
88
|
-
"""
|
|
89
|
-
super(LoggerWithSignals, self).setLevel(level)
|
|
90
|
-
self.level_changed.emit(level=level)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
def patchLogger(force=False):
|
|
94
|
-
"""
|
|
95
|
-
Replaces the logger class used by `logging` to instantiate new loggers.
|
|
96
|
-
Will also restore the active core's previous logger levels.
|
|
97
|
-
|
|
98
|
-
Args:
|
|
99
|
-
force (bool, optional): Force patching of logging logger class when
|
|
100
|
-
True, ignoring whether logging class has already been patched.
|
|
101
|
-
Defaults to False.
|
|
102
|
-
"""
|
|
103
|
-
global logger_patched
|
|
104
|
-
|
|
105
|
-
if force or not logger_patched:
|
|
106
|
-
# disable logging
|
|
107
|
-
logging._acquireLock()
|
|
108
|
-
|
|
109
|
-
try:
|
|
110
|
-
# track patch globally
|
|
111
|
-
logger_patched = True
|
|
112
|
-
|
|
113
|
-
# override default logger class with `LoggerWithSignals`
|
|
114
|
-
logging.setLoggerClass(LoggerWithSignals)
|
|
115
|
-
|
|
116
|
-
# re-enable logging
|
|
117
|
-
finally:
|
|
118
|
-
logging._releaseLock()
|
|
119
|
-
|
|
120
|
-
# restore logger config for loggers initialized pre-patch
|
|
121
|
-
for name, logger in logging.root.manager.loggerDict.items():
|
|
122
|
-
if isinstance(logger, Logger):
|
|
123
|
-
level = getLoggerConfiguration(name)
|
|
124
|
-
if level >= 0:
|
|
125
|
-
logger.setLevel(level)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
def getCoreName(force=False):
|
|
129
|
-
"""
|
|
130
|
-
Derives the core name from the currently running executable.
|
|
131
|
-
|
|
132
|
-
Args:
|
|
133
|
-
force (bool, optional): Forces derivation of core name, ignoring
|
|
134
|
-
pre-existing calculation of core name. Defaults to False.
|
|
135
|
-
|
|
136
|
-
Returns:
|
|
137
|
-
str: Name of core.
|
|
138
|
-
"""
|
|
139
|
-
global core_name
|
|
140
|
-
|
|
141
|
-
if force or not core_name:
|
|
142
|
-
|
|
143
|
-
# use executable name as core name
|
|
144
|
-
if sys.platform == "win32":
|
|
145
|
-
_exe = os.path.basename(sys.executable).replace(".exe", "")
|
|
146
|
-
|
|
147
|
-
# the `sys.executable` method on linux does not return the application
|
|
148
|
-
# python may be running in; use process path pid symlink
|
|
149
|
-
else:
|
|
150
|
-
proc_path = os.path.realpath("/proc/{}/exe".format(os.getpid()))
|
|
151
|
-
_exe = os.path.basename(proc_path)
|
|
152
|
-
|
|
153
|
-
exe_name = _exe.lower()
|
|
154
|
-
|
|
155
|
-
# set core name according to CORE_MAPPINGS dict
|
|
156
|
-
for name, exe_patterns in CORE_MAPPINGS.items():
|
|
157
|
-
if any(pattern in exe_name for pattern in exe_patterns):
|
|
158
|
-
core_name = name
|
|
159
|
-
break
|
|
160
|
-
|
|
161
|
-
# use "blurdev" as core name fallback
|
|
162
|
-
if not core_name:
|
|
163
|
-
core_name = "blurdev"
|
|
164
|
-
|
|
165
|
-
return core_name
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
def getLoggerConfiguration(name):
|
|
169
|
-
"""
|
|
170
|
-
Retrieves the previous level set for the logger name provided. If no
|
|
171
|
-
previous level configuration is found -1 is returned.
|
|
172
|
-
|
|
173
|
-
Args:
|
|
174
|
-
name (str): Name of logger to retrieve level configuration for.
|
|
175
|
-
|
|
176
|
-
Returns:
|
|
177
|
-
int: Numeric value representing logger level. Defaults to -1.
|
|
178
|
-
"""
|
|
179
|
-
config = loadLoggerConfiguration()
|
|
180
|
-
return config.get(name, -1)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
def loadLoggerConfiguration(force=False):
|
|
184
|
-
"""
|
|
185
|
-
Retrieves the previously saved logger levels for the current active core.
|
|
186
|
-
|
|
187
|
-
Args:
|
|
188
|
-
force (bool, optional): Forces retrieval of logger configuration from
|
|
189
|
-
file. Defaults to False.
|
|
190
|
-
|
|
191
|
-
Returns:
|
|
192
|
-
dict: Dictionary of logger levels keyed to they associated logger
|
|
193
|
-
names.
|
|
194
|
-
"""
|
|
195
|
-
global logger_config
|
|
196
|
-
|
|
197
|
-
if force or not logger_config:
|
|
198
|
-
core_name = getCoreName()
|
|
199
|
-
logger_config_path = prefs_path("loggers.json", core_name=core_name)
|
|
200
|
-
|
|
201
|
-
if os.path.exists(logger_config_path):
|
|
202
|
-
try:
|
|
203
|
-
with open(logger_config_path) as logger_config_file_obj:
|
|
204
|
-
logger_config = json.load(logger_config_file_obj)
|
|
205
|
-
except ValueError:
|
|
206
|
-
logger_config = {}
|
|
207
|
-
|
|
208
|
-
return logger_config
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
def saveLoggerConfiguration():
|
|
212
|
-
"""
|
|
213
|
-
Outputs to disk a JSON file of the current core's active loggers' levels.
|
|
214
|
-
"""
|
|
215
|
-
# aggregate logger configuration
|
|
216
|
-
logger_config = {"": logging.root.level}
|
|
217
|
-
for name, logger in logging.root.manager.loggerDict.items():
|
|
218
|
-
if not isinstance(logger, logging.PlaceHolder):
|
|
219
|
-
logger_config[name] = logger.level
|
|
220
|
-
|
|
221
|
-
# derive config location
|
|
222
|
-
core_name = getCoreName()
|
|
223
|
-
config_path = prefs_path(core_name=core_name)
|
|
224
|
-
logger_config_path = os.path.join(config_path, "loggers.json")
|
|
225
|
-
temp_logger_config_path = logger_config_path + ".temp"
|
|
226
|
-
|
|
227
|
-
# ensure destination exists
|
|
228
|
-
if not os.path.exists(config_path):
|
|
229
|
-
os.makedirs(config_path)
|
|
230
|
-
|
|
231
|
-
# output logger configuration to temp file then move on success
|
|
232
|
-
try:
|
|
233
|
-
json_str = json.dumps(logger_config, sort_keys=True, indent=4)
|
|
234
|
-
with open(temp_logger_config_path, "w") as logger_config_file_obj:
|
|
235
|
-
logger_config_file_obj.write(json_str)
|
|
236
|
-
shutil.move(temp_logger_config_path, logger_config_path)
|
|
237
|
-
except Exception:
|
|
238
|
-
pass
|