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
|
@@ -1,299 +1,310 @@
|
|
|
1
|
-
from __future__ import print_function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
from
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
self.
|
|
67
|
-
self.
|
|
68
|
-
self.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
#
|
|
72
|
-
#
|
|
73
|
-
|
|
74
|
-
self.
|
|
75
|
-
|
|
76
|
-
self.
|
|
77
|
-
|
|
78
|
-
self.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
def
|
|
91
|
-
""
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
self.delayables[delayable]
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
self.delayables
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
1
|
+
from __future__ import absolute_import, print_function
|
|
2
|
+
|
|
3
|
+
import time
|
|
4
|
+
import warnings
|
|
5
|
+
import weakref
|
|
6
|
+
from collections import OrderedDict
|
|
7
|
+
|
|
8
|
+
import six
|
|
9
|
+
from Qt import QtCompat
|
|
10
|
+
from Qt.QtCore import QObject, QTimer, Signal
|
|
11
|
+
|
|
12
|
+
from .delayables import Delayable
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
from collections.abc import MutableSet
|
|
16
|
+
except ImportError:
|
|
17
|
+
# Due to the older versions of six installed by default with DCC's like
|
|
18
|
+
# Maya 2020, we can't rely on six.moves.collections_abc, so handle
|
|
19
|
+
# the py 2.7 import
|
|
20
|
+
from collections import MutableSet
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# https://stackoverflow.com/a/7829569
|
|
24
|
+
class OrderedSet(MutableSet):
|
|
25
|
+
def __init__(self, values=()):
|
|
26
|
+
self._od = OrderedDict().fromkeys(values)
|
|
27
|
+
|
|
28
|
+
def __len__(self):
|
|
29
|
+
return len(self._od)
|
|
30
|
+
|
|
31
|
+
def __iter__(self):
|
|
32
|
+
return iter(self._od)
|
|
33
|
+
|
|
34
|
+
def __contains__(self, value):
|
|
35
|
+
return value in self._od
|
|
36
|
+
|
|
37
|
+
def add(self, value):
|
|
38
|
+
self._od[value] = None
|
|
39
|
+
|
|
40
|
+
def discard(self, value):
|
|
41
|
+
self._od.pop(value, None)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class OrderedWeakrefSet(weakref.WeakSet):
|
|
45
|
+
def __init__(self, values=()):
|
|
46
|
+
super(OrderedWeakrefSet, self).__init__()
|
|
47
|
+
self.data = OrderedSet()
|
|
48
|
+
for elem in values:
|
|
49
|
+
self.add(elem)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class DelayableEngine(QObject):
|
|
53
|
+
"""Provides a way for multiple DocumentEditors to run code over
|
|
54
|
+
multiple Qt event loops in chunks preventing locking up the ui.
|
|
55
|
+
|
|
56
|
+
Signals:
|
|
57
|
+
processing_finished (int, float): Emitted when the engine finishes
|
|
58
|
+
processing successfully.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
_instance = {}
|
|
62
|
+
processing_finished = Signal()
|
|
63
|
+
|
|
64
|
+
def __init__(self, name, parent=None, interval=0):
|
|
65
|
+
super(DelayableEngine, self).__init__()
|
|
66
|
+
self.name = name
|
|
67
|
+
self.documents = OrderedWeakrefSet()
|
|
68
|
+
self.delayables = {}
|
|
69
|
+
self.maxLoopTime = 0.01
|
|
70
|
+
self.start_time = time.time()
|
|
71
|
+
# It's likely we wont' finish processing all documents and all delayables
|
|
72
|
+
# before we run out of time. These variables keep track of where we stopped.
|
|
73
|
+
self.document_index = 0
|
|
74
|
+
self.delayable_index = 0
|
|
75
|
+
|
|
76
|
+
self.timer = QTimer(self)
|
|
77
|
+
self.timer.setInterval(interval)
|
|
78
|
+
self.timer.timeout.connect(self.loop)
|
|
79
|
+
|
|
80
|
+
# These values are reset when enqueue needs to start self.timer
|
|
81
|
+
# Each of these lists have a item added when self.loop exits
|
|
82
|
+
# (this can be it finished or ran out of time)
|
|
83
|
+
# Number of documents that had a delayable.loop called on them this loop
|
|
84
|
+
self.processed = []
|
|
85
|
+
# Time spent processing delayables for this self.loop
|
|
86
|
+
self.processing_time = []
|
|
87
|
+
# Number of nonVisible items that were skipped for this self.loop
|
|
88
|
+
self.skipped = []
|
|
89
|
+
|
|
90
|
+
def __repr__(self):
|
|
91
|
+
return '{}.{}("{}")'.format(
|
|
92
|
+
self.__module__,
|
|
93
|
+
self.__class__.__name__,
|
|
94
|
+
self.name,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
def __str__(self):
|
|
98
|
+
return '{}("{}")'.format(self.__class__.__name__, self.name)
|
|
99
|
+
|
|
100
|
+
def add_delayable(self, delayable):
|
|
101
|
+
"""Add a Delayable subclass instance for processing in this engine.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
delayable (Delayable or str): A Delayable instance or the key identifier.
|
|
105
|
+
If a Delayable instance is passed, it will replace any previous
|
|
106
|
+
instances. If a string is passed it will not replace previous instance.
|
|
107
|
+
|
|
108
|
+
Raises:
|
|
109
|
+
KeyError: A invalid key identifier string was passed.
|
|
110
|
+
"""
|
|
111
|
+
if isinstance(delayable, six.string_types):
|
|
112
|
+
if delayable in self.delayables:
|
|
113
|
+
# Don't replace the instance if a string is passed
|
|
114
|
+
return
|
|
115
|
+
for cls in Delayable._all_subclasses():
|
|
116
|
+
if cls.key == delayable:
|
|
117
|
+
delayable = cls(self)
|
|
118
|
+
break
|
|
119
|
+
else:
|
|
120
|
+
raise KeyError('No Delayable found with key: "{}"'.format(delayable))
|
|
121
|
+
elif delayable.key in self.delayables:
|
|
122
|
+
# Remove the old delayable if it exists so we can replace it.
|
|
123
|
+
self.remove_delayable(self.delayables[delayable.key])
|
|
124
|
+
|
|
125
|
+
self.delayables[delayable.key] = delayable
|
|
126
|
+
for document in self.documents:
|
|
127
|
+
delayable.add_document(document)
|
|
128
|
+
|
|
129
|
+
def add_document(self, document):
|
|
130
|
+
self.documents.add(document)
|
|
131
|
+
document.delayable_engine = self
|
|
132
|
+
for delayable in self.delayables:
|
|
133
|
+
self.delayables[delayable].add_document(document)
|
|
134
|
+
|
|
135
|
+
def add_supported_delayables(self, name):
|
|
136
|
+
"""Add all valid Delayable subclasses that have name in their supports."""
|
|
137
|
+
for delayable in Delayable._all_subclasses():
|
|
138
|
+
if delayable.key not in self.delayables:
|
|
139
|
+
if name in delayable.supports and delayable.key != 'invalid':
|
|
140
|
+
self.add_delayable(delayable(self))
|
|
141
|
+
|
|
142
|
+
def delayable_enabled(self, delayable):
|
|
143
|
+
"""Returns True if delayable is currently added.
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
delayable (Delayable or str): A Delayable instance or the key identifier.
|
|
147
|
+
|
|
148
|
+
Returns:
|
|
149
|
+
bool: Is the given delayable installed for this engine.
|
|
150
|
+
"""
|
|
151
|
+
if isinstance(delayable, Delayable):
|
|
152
|
+
delayable = delayable.key
|
|
153
|
+
return delayable in self.delayables
|
|
154
|
+
|
|
155
|
+
def enqueue(self, document, key, *args):
|
|
156
|
+
# Only add a item to be processed if we have a delayable that can
|
|
157
|
+
# process the requested key.
|
|
158
|
+
if key in self.delayables:
|
|
159
|
+
# There is only ever one instance of a delayable class processed
|
|
160
|
+
# If we already have a class enqueued, merge the arguments so we
|
|
161
|
+
# don't end up loosing some processing.
|
|
162
|
+
if key in document.delayable_info:
|
|
163
|
+
args = self.delayables[key].merge_args(
|
|
164
|
+
document.delayable_info[key], args
|
|
165
|
+
)
|
|
166
|
+
document.delayable_info[key] = args
|
|
167
|
+
if not self.timer.isActive():
|
|
168
|
+
self.timer.start()
|
|
169
|
+
self.processed = []
|
|
170
|
+
self.processing_time = []
|
|
171
|
+
self.skipped = []
|
|
172
|
+
return True
|
|
173
|
+
return False
|
|
174
|
+
|
|
175
|
+
def expired(self):
|
|
176
|
+
return time.time() - self.start_time > self.maxLoopTime
|
|
177
|
+
|
|
178
|
+
@classmethod
|
|
179
|
+
def instance(cls, name, parent=None, interval=0):
|
|
180
|
+
"""Returns a shared instance of DelayableEngine, creating the instance
|
|
181
|
+
if needed.
|
|
182
|
+
|
|
183
|
+
Args:
|
|
184
|
+
name (str): The name of the delayable engine to get the instance of.
|
|
185
|
+
parent (QWidget, optional): If a new instance is created, use this
|
|
186
|
+
as its parent. Ignored otherwise.
|
|
187
|
+
interval (int, optional): If a new instance is created, use this as
|
|
188
|
+
its interval value. Defaults to zero.
|
|
189
|
+
"""
|
|
190
|
+
if name not in cls._instance:
|
|
191
|
+
cls._instance[name] = cls(name, parent=parent, interval=interval)
|
|
192
|
+
return cls._instance[name]
|
|
193
|
+
|
|
194
|
+
def loop(self): # noqa C901
|
|
195
|
+
self.start_time = time.time()
|
|
196
|
+
documents = list(self.documents)
|
|
197
|
+
# offset documents by the document_index so we can pickup where we left off
|
|
198
|
+
documents = documents[self.document_index :] + documents[: self.document_index]
|
|
199
|
+
|
|
200
|
+
count = 0
|
|
201
|
+
skipped = 0
|
|
202
|
+
finished = True
|
|
203
|
+
first_loop = True
|
|
204
|
+
while not self.expired():
|
|
205
|
+
for document in documents:
|
|
206
|
+
self.document_index += 1
|
|
207
|
+
if self.document_index >= len(documents):
|
|
208
|
+
self.document_index = 0
|
|
209
|
+
|
|
210
|
+
if not QtCompat.isValid(document):
|
|
211
|
+
if document in self.documents:
|
|
212
|
+
self.documents.remove(document)
|
|
213
|
+
print('Removing deleted document')
|
|
214
|
+
continue
|
|
215
|
+
|
|
216
|
+
if not document.delayable_info:
|
|
217
|
+
continue
|
|
218
|
+
|
|
219
|
+
if not document.isVisible() and first_loop:
|
|
220
|
+
skipped += 1
|
|
221
|
+
continue
|
|
222
|
+
|
|
223
|
+
keys = list(document.delayable_info.keys())
|
|
224
|
+
keys = keys[self.delayable_index :] + keys[: self.delayable_index]
|
|
225
|
+
for key in keys:
|
|
226
|
+
self.delayable_index += 1
|
|
227
|
+
if self.delayable_index > len(keys):
|
|
228
|
+
self.delayable_index = 0
|
|
229
|
+
|
|
230
|
+
# delayable_info should only have keys for delayables we can access.
|
|
231
|
+
delayable = self.delayables[key]
|
|
232
|
+
|
|
233
|
+
args = document.delayable_info[key]
|
|
234
|
+
try:
|
|
235
|
+
args = delayable.loop(document, *args)
|
|
236
|
+
except Exception:
|
|
237
|
+
warnings.warn('Error processing {}, canceling it'.format(key))
|
|
238
|
+
del document.delayable_info[key]
|
|
239
|
+
raise
|
|
240
|
+
if args:
|
|
241
|
+
document.delayable_info[key] = args
|
|
242
|
+
# We need to process more items
|
|
243
|
+
finished = False
|
|
244
|
+
else:
|
|
245
|
+
del document.delayable_info[key]
|
|
246
|
+
count += 1
|
|
247
|
+
if self.expired():
|
|
248
|
+
self.processed.append(count)
|
|
249
|
+
self.processing_time.append(time.time() - self.start_time)
|
|
250
|
+
self.skipped.append(skipped)
|
|
251
|
+
return
|
|
252
|
+
|
|
253
|
+
first_loop = False
|
|
254
|
+
|
|
255
|
+
self.processed.append(count)
|
|
256
|
+
self.processing_time.append(time.time() - self.start_time)
|
|
257
|
+
self.skipped.append(skipped)
|
|
258
|
+
if finished:
|
|
259
|
+
# Nothing else to do for now, just exit
|
|
260
|
+
self.timer.stop()
|
|
261
|
+
self.processing_finished.emit()
|
|
262
|
+
|
|
263
|
+
def remove_document(self, document):
|
|
264
|
+
"""Removes a document from being processed"""
|
|
265
|
+
if document in self.documents:
|
|
266
|
+
for delayable in self.delayables:
|
|
267
|
+
self.delayables[delayable].remove_document(document)
|
|
268
|
+
|
|
269
|
+
self.documents.remove(document)
|
|
270
|
+
document.delayable_engine = type(self).instance('default')
|
|
271
|
+
|
|
272
|
+
def remove_delayable(self, delayable):
|
|
273
|
+
"""Removes a Delayable subclass instance for processing in this engine.
|
|
274
|
+
|
|
275
|
+
Args:
|
|
276
|
+
delayable (Delayable or str): A Delayable instance or the key identifier.
|
|
277
|
+
Remove this delayable from the current documents if it was added.
|
|
278
|
+
"""
|
|
279
|
+
if isinstance(delayable, six.string_types):
|
|
280
|
+
if delayable not in self.delayables:
|
|
281
|
+
return
|
|
282
|
+
delayable = self.delayables[delayable]
|
|
283
|
+
if delayable:
|
|
284
|
+
for document in self.documents:
|
|
285
|
+
delayable.remove_document(document)
|
|
286
|
+
# Stop processing this delayable if it's currently processing.
|
|
287
|
+
try:
|
|
288
|
+
del document.delayable_info[delayable.key]
|
|
289
|
+
except KeyError:
|
|
290
|
+
pass
|
|
291
|
+
self.delayables.pop(delayable.key)
|
|
292
|
+
|
|
293
|
+
def set_delayable_enabled(self, delayable, enabled):
|
|
294
|
+
"""Add or remove the delayable provided.
|
|
295
|
+
|
|
296
|
+
Args:
|
|
297
|
+
delayable (Delayable or str): A Delayable instance or the key identifier.
|
|
298
|
+
enabled (bool): If True installs delayable, if False removes delayable.
|
|
299
|
+
|
|
300
|
+
See Also:
|
|
301
|
+
:py:meth:`DelayableEngine.add_delayable` and
|
|
302
|
+
:py:meth:`DelayableEngine.remove_delayable`
|
|
303
|
+
|
|
304
|
+
Raises:
|
|
305
|
+
KeyError: A invalid key identifier string was passed.
|
|
306
|
+
"""
|
|
307
|
+
if enabled:
|
|
308
|
+
self.add_delayable(delayable)
|
|
309
|
+
else:
|
|
310
|
+
self.remove_delayable(delayable)
|