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,125 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
def
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"""
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if widget.parent():
|
|
86
|
-
widget.setPalette(widget.parent().palette())
|
|
87
|
-
|
|
88
|
-
if not uiname:
|
|
89
|
-
uiname = os.path.basename(filename).split('.')[0]
|
|
90
|
-
|
|
91
|
-
QtCompat.loadUi(os.path.split(filename)[0] + '/ui/%s.ui' % uiname, widget)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
def connectLogger(
|
|
95
|
-
parent, start=True, sequence='F2', text='Show Logger', objName='uiShowLoggerACT'
|
|
96
|
-
):
|
|
97
|
-
"""Optionally starts the logger, and creates a QAction on the provided parent with
|
|
98
|
-
the provided keyboard shortcut to run it.
|
|
99
|
-
|
|
100
|
-
Args:
|
|
101
|
-
parent: The parent widget, normally a window
|
|
102
|
-
start (bool, optional): Start logging immediately. Defaults to True. Disable if
|
|
103
|
-
you don't want to redirect immediately.
|
|
104
|
-
sequence (str, optional): A string representing the keyboard shortcut associated
|
|
105
|
-
with the QAction. Defaults to 'F2'
|
|
106
|
-
text (str, optional): The display text for the QAction. Defaults to 'Show Logger'
|
|
107
|
-
objName (str, optional): Set the QAction's objectName to this value. Defaults to
|
|
108
|
-
'uiShowLoggerACT'
|
|
109
|
-
|
|
110
|
-
Returns:
|
|
111
|
-
QAction: The created QAction
|
|
112
|
-
"""
|
|
113
|
-
import blurdev
|
|
114
|
-
from Qt.QtGui import QKeySequence
|
|
115
|
-
from Qt.QtWidgets import QAction
|
|
116
|
-
|
|
117
|
-
if start:
|
|
118
|
-
blurdev.core.logger(parent)
|
|
119
|
-
# Create shortcuts for launching the logger
|
|
120
|
-
action = QAction(text, parent)
|
|
121
|
-
action.setObjectName(objName)
|
|
122
|
-
action.triggered.connect(blurdev.core.showLogger)
|
|
123
|
-
action.setShortcut(QKeySequence(sequence))
|
|
124
|
-
parent.addAction(action)
|
|
125
|
-
return action
|
|
1
|
+
from __future__ import absolute_import
|
|
2
|
+
|
|
3
|
+
from functools import partial
|
|
4
|
+
|
|
5
|
+
from Qt.QtCore import Property
|
|
6
|
+
|
|
7
|
+
from .dialog import Dialog # noqa: F401
|
|
8
|
+
from .window import Window # noqa: F401
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def QtPropertyInit(name, default, callback=None, typ=None):
|
|
12
|
+
"""Initializes a default Property value with a usable getter and setter.
|
|
13
|
+
|
|
14
|
+
You can optionally pass a function that will get called any time the property
|
|
15
|
+
is set. If using the same callback for multiple properties, you may want to
|
|
16
|
+
use the preditor.decorators.singleShot decorator to prevent your function getting
|
|
17
|
+
called multiple times at once. This callback must accept the attribute name and
|
|
18
|
+
value being set.
|
|
19
|
+
|
|
20
|
+
Example:
|
|
21
|
+
class TestClass(QWidget):
|
|
22
|
+
def __init__(self, *args, **kwargs):
|
|
23
|
+
super(TestClass, self).__init__(*args, **kwargs)
|
|
24
|
+
|
|
25
|
+
stdoutColor = QtPropertyInit('_stdoutColor', QColor(0, 0, 255))
|
|
26
|
+
pyForegroundColor = QtPropertyInit('_pyForegroundColor', QColor(0, 0, 255))
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
name(str): The name of internal attribute to store to and lookup from.
|
|
30
|
+
default: The property's default value. This will also define the Property type
|
|
31
|
+
if typ is not set.
|
|
32
|
+
callback(callable): If provided this function is called when the property is
|
|
33
|
+
set.
|
|
34
|
+
typ (class, optional): If not None this value is used to specify the type of
|
|
35
|
+
the Property. This is useful when you need to specify a property as python's
|
|
36
|
+
object but pass a default value of a given class.
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
Property
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
def _getattrDefault(default, self, attrName):
|
|
43
|
+
try:
|
|
44
|
+
value = getattr(self, attrName)
|
|
45
|
+
except AttributeError:
|
|
46
|
+
setattr(self, attrName, default)
|
|
47
|
+
return default
|
|
48
|
+
return value
|
|
49
|
+
|
|
50
|
+
def _setattrCallback(callback, attrName, self, value):
|
|
51
|
+
setattr(self, attrName, value)
|
|
52
|
+
if callback:
|
|
53
|
+
callback(self, attrName, value)
|
|
54
|
+
|
|
55
|
+
ga = partial(_getattrDefault, default)
|
|
56
|
+
sa = partial(_setattrCallback, callback, name)
|
|
57
|
+
# Use the default value's class if typ is not provided.
|
|
58
|
+
if typ is None:
|
|
59
|
+
typ = default.__class__
|
|
60
|
+
return Property(typ, fget=(lambda s: ga(s, name)), fset=(lambda s, v: sa(s, v)))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def loadUi(filename, widget, uiname=''):
|
|
64
|
+
"""use's Qt's uic loader to load dynamic interafces onto the inputed widget
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
filename (str): The python filename. Its basename will be split off, and a
|
|
68
|
+
ui folder will be added. The file ext will be changed to .ui
|
|
69
|
+
widget (QWidget): The basewidget the ui file will be loaded onto.
|
|
70
|
+
uiname (str, optional): Used instead of the basename. This is useful if
|
|
71
|
+
filename is not the same as the ui file you want to load.
|
|
72
|
+
"""
|
|
73
|
+
import os.path
|
|
74
|
+
|
|
75
|
+
from Qt import QtCompat
|
|
76
|
+
|
|
77
|
+
# first, inherit the palette of the parent
|
|
78
|
+
if widget.parent():
|
|
79
|
+
widget.setPalette(widget.parent().palette())
|
|
80
|
+
|
|
81
|
+
if not uiname:
|
|
82
|
+
uiname = os.path.basename(filename).split('.')[0]
|
|
83
|
+
|
|
84
|
+
QtCompat.loadUi(os.path.split(filename)[0] + '/ui/%s.ui' % uiname, widget)
|
preditor/gui/app.py
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
from __future__ import absolute_import
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
import Qt
|
|
7
|
+
from Qt.QtGui import QIcon
|
|
8
|
+
from Qt.QtWidgets import QApplication, QDialog, QMainWindow, QSplashScreen
|
|
9
|
+
|
|
10
|
+
from .. import DEFAULT_CORE_NAME, resourcePath, settings
|
|
11
|
+
|
|
12
|
+
logger = logging.getLogger(__name__)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class App(object):
|
|
16
|
+
"""Used to create and configure the QApplication instance.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
name (str, optional): Set the QApplication application name to this value.
|
|
20
|
+
args (list, optional): The arguments used to instantiate the QApplication
|
|
21
|
+
if one isn't already initialized.
|
|
22
|
+
app (QApplication, optional): An instance of a QApplication to use
|
|
23
|
+
instead of creating one.
|
|
24
|
+
|
|
25
|
+
Raises:
|
|
26
|
+
RuntimeError: If DISPLAY is not set when running on linux, or the
|
|
27
|
+
current application isn't a instance of QApplication(ie using a
|
|
28
|
+
QCoreApplication).
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
def __init__(self, name=None, args=None, app=None):
|
|
32
|
+
# Used to track if this instance had to create the QApplication or if it
|
|
33
|
+
# was already created
|
|
34
|
+
self.app_created = False
|
|
35
|
+
# If we made the QApplication, did we call exec_ already?
|
|
36
|
+
self.app_has_exec = False
|
|
37
|
+
|
|
38
|
+
if app is None:
|
|
39
|
+
app = QApplication.instance()
|
|
40
|
+
|
|
41
|
+
self.app = app
|
|
42
|
+
|
|
43
|
+
if not self.app:
|
|
44
|
+
# Check for headless environment's
|
|
45
|
+
if settings.OS_TYPE == 'Linux' and os.environ.get('DISPLAY') is None:
|
|
46
|
+
raise RuntimeError(
|
|
47
|
+
'The PrEditor gui can not run in a headless environment.'
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
if args is None:
|
|
51
|
+
args = []
|
|
52
|
+
# create a new application
|
|
53
|
+
if self.app is None:
|
|
54
|
+
args.extend(self.dpi_awareness_args())
|
|
55
|
+
self.app = QApplication(args)
|
|
56
|
+
self.app_created = True
|
|
57
|
+
# If we are creating the application, configure it
|
|
58
|
+
self.configure_standalone()
|
|
59
|
+
|
|
60
|
+
if not isinstance(self.app, QApplication):
|
|
61
|
+
raise RuntimeError(
|
|
62
|
+
"PrEditor's gui can only be run using a QApplication instance."
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
if self.app and name:
|
|
66
|
+
# If a application name was passed, update the QApplication's
|
|
67
|
+
# application name.
|
|
68
|
+
self.app.setApplicationName(name)
|
|
69
|
+
self.set_app_id(name)
|
|
70
|
+
|
|
71
|
+
def configure_standalone(self):
|
|
72
|
+
"""Update the QApplication for standalone running. Updates the icon and
|
|
73
|
+
sets its style to default_style_name."""
|
|
74
|
+
self.app.setWindowIcon(QIcon(resourcePath('img/preditor.png')))
|
|
75
|
+
self.app.setStyle(self.default_style_name())
|
|
76
|
+
|
|
77
|
+
@staticmethod
|
|
78
|
+
def default_style_name():
|
|
79
|
+
"""The default style name used when setting up the QApplication.
|
|
80
|
+
|
|
81
|
+
In Qt4 this is Plastique, in Qt5 this is Fusion.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
if Qt.IsPyQt4 or Qt.IsPySide:
|
|
85
|
+
return 'Plastique'
|
|
86
|
+
return 'Fusion'
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def dpi_awareness_args(cls):
|
|
90
|
+
"""On windows sets dpiawareness platform flag to 0 to enable
|
|
91
|
+
per-monitor scaling support in Qt.
|
|
92
|
+
|
|
93
|
+
Returns:
|
|
94
|
+
args: Extend the arguments used to intialize the QApplication.
|
|
95
|
+
"""
|
|
96
|
+
if settings.OS_TYPE == "Windows" and Qt.IsPyQt5:
|
|
97
|
+
# Make Qt automatically scale based on the monitor the window is
|
|
98
|
+
# currently located.
|
|
99
|
+
return ["--platform", "windows:dpiawareness=0"]
|
|
100
|
+
return []
|
|
101
|
+
|
|
102
|
+
@classmethod
|
|
103
|
+
def root_window(cls):
|
|
104
|
+
"""Returns the currently active window. Attempts to find the top level
|
|
105
|
+
QMainWindow or QDialog for the current Qt application.
|
|
106
|
+
"""
|
|
107
|
+
inst = QApplication.instance()
|
|
108
|
+
if inst:
|
|
109
|
+
root_window = inst.activeWindow()
|
|
110
|
+
# Ignore QSplashScreen's, they should never be considered the root window.
|
|
111
|
+
if isinstance(root_window, QSplashScreen):
|
|
112
|
+
root_window = None
|
|
113
|
+
|
|
114
|
+
# If the application does not have focus try to find A top level widget
|
|
115
|
+
# that doesn't have a parent and is a QMainWindow or QDialog
|
|
116
|
+
if root_window is None:
|
|
117
|
+
windows = []
|
|
118
|
+
dialogs = []
|
|
119
|
+
for w in inst.topLevelWidgets():
|
|
120
|
+
if w.parent() is None:
|
|
121
|
+
if isinstance(w, QMainWindow):
|
|
122
|
+
windows.append(w)
|
|
123
|
+
elif isinstance(w, QDialog):
|
|
124
|
+
dialogs.append(w)
|
|
125
|
+
if windows:
|
|
126
|
+
root_window = windows[0]
|
|
127
|
+
elif dialogs:
|
|
128
|
+
root_window = dialogs[0]
|
|
129
|
+
|
|
130
|
+
# grab the root window
|
|
131
|
+
if root_window:
|
|
132
|
+
while root_window.parent():
|
|
133
|
+
parent = root_window.parent()
|
|
134
|
+
if isinstance(parent, QSplashScreen):
|
|
135
|
+
return root_window
|
|
136
|
+
else:
|
|
137
|
+
root_window = parent
|
|
138
|
+
return root_window
|
|
139
|
+
|
|
140
|
+
@classmethod
|
|
141
|
+
def set_app_id(cls, app_id=DEFAULT_CORE_NAME):
|
|
142
|
+
if settings.OS_TYPE == "Windows":
|
|
143
|
+
# Set the app user model id here not in the window class so it doesn't
|
|
144
|
+
# try to set the app id for applications that already set the app id.
|
|
145
|
+
try:
|
|
146
|
+
from casement.app_id import AppId
|
|
147
|
+
except ImportError:
|
|
148
|
+
logger.debug(
|
|
149
|
+
"Unable to configure taskbar grouping, use `pip install "
|
|
150
|
+
"casement` to enable this."
|
|
151
|
+
)
|
|
152
|
+
else:
|
|
153
|
+
AppId.set_for_application(app_id)
|
|
154
|
+
|
|
155
|
+
def start(self):
|
|
156
|
+
"""Exec's the QApplication if it hasn't already been started."""
|
|
157
|
+
if self.app_created and self.app and not self.app_has_exec:
|
|
158
|
+
self.app_has_exec = True
|
|
159
|
+
self.app.exec_()
|