je-editor 0.0.186__tar.gz → 0.0.187__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {je_editor-0.0.186 → je_editor-0.0.187}/PKG-INFO +2 -2
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/__init__.py +2 -2
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/__main__.py +1 -1
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/plaintext_code_edit/code_edit_plaintext.py +6 -1
- je_editor-0.0.187/je_editor/pyside_ui/code/syntax/python_syntax.py +62 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/syntax/syntax_setting.py +2 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/main_editor.py +1 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/redirect_manager/redirect_manager_class.py +2 -1
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor.egg-info/PKG-INFO +2 -2
- {je_editor-0.0.186 → je_editor-0.0.187}/pyproject.toml +1 -1
- je_editor-0.0.186/je_editor/pyside_ui/code/syntax/python_syntax.py +0 -39
- {je_editor-0.0.186 → je_editor-0.0.187}/LICENSE +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/README.md +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/browser/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/browser/browser_download_window.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/browser/browser_serach_lineedit.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/browser/browser_view.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/browser/browser_widget.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/auto_save/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/auto_save/auto_save_manager.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/auto_save/auto_save_thread.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/code_format/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/code_format/pep8_format.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/code_process/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/code_process/code_exec.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/plaintext_code_edit/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/running_process_manager.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/shell_process/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/shell_process/shell_exec.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/syntax/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/textedit_code_result/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/textedit_code_result/code_record.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/file_dialog/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/file_dialog/create_file_dialog.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/file_dialog/open_file_dialog.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/file_dialog/save_file_dialog.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/search_ui/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/search_ui/search_error_box.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/search_ui/search_text_box.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/dock/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/dock/destroy_dock.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/editor/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/editor/editor_widget.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/editor/editor_widget_dock.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/editor/process_input.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/ipython_widget/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/ipython_widget/rich_jupyter.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/check_style_menu/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/check_style_menu/build_check_style_menu.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/dock_menu/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/dock_menu/build_dock_menu.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/file_menu/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/file_menu/build_file_menu.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/help_menu/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/help_menu/build_help_menu.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/language_menu/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/language_menu/build_language_server.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/python_env_menu/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/python_env_menu/build_venv_menu.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/run_menu/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/run_menu/build_run_menu.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/run_menu/under_run_menu/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/run_menu/under_run_menu/build_debug_menu.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/run_menu/under_run_menu/build_program_menu.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/run_menu/under_run_menu/build_shell_menu.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/run_menu/under_run_menu/utils.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/set_menu_bar.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/style_menu/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/style_menu/build_style_menu.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/tab_menu/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/tab_menu/build_tab_menu.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/text_menu/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/text_menu/build_text_menu.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/save_settings/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/save_settings/setting_utils.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/save_settings/user_color_setting_file.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/save_settings/user_setting_file.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/system_tray/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/system_tray/extend_system_tray.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/start_editor.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/encodings/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/encodings/python_encodings.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/exception/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/exception/exception_tags.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/exception/exceptions.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/file/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/file/open/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/file/open/open_file.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/file/save/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/file/save/save_file.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/json/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/json/json_file.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/json_format/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/json_format/json_process.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/logging/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/logging/loggin_instance.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/multi_language/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/multi_language/english.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/multi_language/multi_language_wrapper.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/multi_language/traditional_chinese.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/redirect_manager/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/venv_check/__init__.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/venv_check/check_venv.py +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor.egg-info/SOURCES.txt +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor.egg-info/dependency_links.txt +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor.egg-info/requires.txt +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/je_editor.egg-info/top_level.txt +0 -0
- {je_editor-0.0.186 → je_editor-0.0.187}/setup.cfg +0 -0
@@ -2,7 +2,7 @@ from je_editor.pyside_ui.browser.browser_widget import BrowserWidget
|
|
2
2
|
from je_editor.pyside_ui.code.code_process.code_exec import ExecManager
|
3
3
|
from je_editor.pyside_ui.code.shell_process.shell_exec import ShellManager
|
4
4
|
from je_editor.pyside_ui.code.syntax.python_syntax import PythonHighlighter
|
5
|
-
from je_editor.pyside_ui.code.syntax.syntax_setting import
|
5
|
+
from je_editor.pyside_ui.code.syntax.syntax_setting import syntax_extend_setting_dict, syntax_rule_setting_dict
|
6
6
|
from je_editor.pyside_ui.main_ui.editor.editor_widget import EditorWidget
|
7
7
|
from je_editor.pyside_ui.main_ui.editor.editor_widget_dock import FullEditorWidget
|
8
8
|
from je_editor.pyside_ui.main_ui.main_editor import EDITOR_EXTEND_TAB
|
@@ -26,7 +26,7 @@ __all__ = [
|
|
26
26
|
"start_editor", "EditorMain", "EDITOR_EXTEND_TAB",
|
27
27
|
"JEditorException", "JEditorExecException", "FullEditorWidget",
|
28
28
|
"JEditorRunOnShellException", "JEditorSaveFileException", "syntax_rule_setting_dict",
|
29
|
-
"JEditorOpenFileException", "JEditorContentFileException", "
|
29
|
+
"JEditorOpenFileException", "JEditorContentFileException", "syntax_extend_setting_dict",
|
30
30
|
"JEditorCantFindLanguageException", "JEditorJsonException", "PythonHighlighter",
|
31
31
|
"user_setting_dict", "user_setting_color_dict", "EditorWidget", "BrowserWidget",
|
32
32
|
"ExecManager", "ShellManager", "traditional_chinese_word_dict", "english_word_dict",
|
@@ -43,6 +43,7 @@ class CodeEditor(QPlainTextEdit):
|
|
43
43
|
self.check_env()
|
44
44
|
# Self main window (parent)
|
45
45
|
self.main_window = main_window
|
46
|
+
self.current_file = main_window.current_file
|
46
47
|
|
47
48
|
self.skip_popup_behavior_list = [
|
48
49
|
Qt.Key.Key_Enter, Qt.Key.Key_Return, Qt.Key.Key_Up, Qt.Key.Key_Down,
|
@@ -64,7 +65,7 @@ class CodeEditor(QPlainTextEdit):
|
|
64
65
|
self.setTabStopDistance(
|
65
66
|
QtGui.QFontMetricsF(self.font()).horizontalAdvance(" ")
|
66
67
|
)
|
67
|
-
self.highlighter = PythonHighlighter(self.document())
|
68
|
+
self.highlighter = PythonHighlighter(self.document(), main_window=self)
|
68
69
|
self.highlight_current_line()
|
69
70
|
self.setLineWrapMode(self.LineWrapMode.NoWrap)
|
70
71
|
# Search Text
|
@@ -79,6 +80,10 @@ class CodeEditor(QPlainTextEdit):
|
|
79
80
|
self.completer: Union[None, QCompleter] = None
|
80
81
|
self.set_complete([])
|
81
82
|
|
83
|
+
def reset_highlighter(self):
|
84
|
+
self.highlighter = PythonHighlighter(self.document(), main_window=self)
|
85
|
+
self.highlight_current_line()
|
86
|
+
|
82
87
|
def check_env(self):
|
83
88
|
jeditor_logger.info("CodeEditor check_env")
|
84
89
|
path = venv_check()
|
@@ -0,0 +1,62 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from pathlib import Path
|
4
|
+
from typing import TYPE_CHECKING
|
5
|
+
|
6
|
+
if TYPE_CHECKING:
|
7
|
+
from je_editor.pyside_ui.code.plaintext_code_edit.code_edit_plaintext import CodeEditor
|
8
|
+
|
9
|
+
from PySide6.QtCore import QRegularExpression
|
10
|
+
from PySide6.QtGui import QSyntaxHighlighter
|
11
|
+
from PySide6.QtGui import QTextCharFormat
|
12
|
+
|
13
|
+
from je_editor.pyside_ui.code.syntax.syntax_setting import syntax_word_setting_dict, syntax_rule_setting_dict, \
|
14
|
+
syntax_extend_setting_dict
|
15
|
+
from je_editor.utils.logging.loggin_instance import jeditor_logger
|
16
|
+
|
17
|
+
|
18
|
+
class PythonHighlighter(QSyntaxHighlighter):
|
19
|
+
def __init__(self, parent=None, main_window: CodeEditor = None):
|
20
|
+
jeditor_logger.info(f"Init PythonHighlighter parent: {parent}")
|
21
|
+
super().__init__(parent)
|
22
|
+
|
23
|
+
self.highlight_rules = []
|
24
|
+
if main_window.current_file is not None:
|
25
|
+
current_file_suffix = Path(main_window.current_file).suffix
|
26
|
+
else:
|
27
|
+
current_file_suffix = ".py"
|
28
|
+
if current_file_suffix == ".py":
|
29
|
+
# Highlight
|
30
|
+
for rule_variable_dict in syntax_word_setting_dict.values():
|
31
|
+
color = rule_variable_dict.get("color")
|
32
|
+
text_char_format = QTextCharFormat()
|
33
|
+
text_char_format.setForeground(color)
|
34
|
+
for word in rule_variable_dict.get("words"):
|
35
|
+
pattern = QRegularExpression(rf"\b{word}\b")
|
36
|
+
self.highlight_rules.append((pattern, text_char_format))
|
37
|
+
for rule_variable_dict in syntax_rule_setting_dict.values():
|
38
|
+
color = rule_variable_dict.get("color")
|
39
|
+
text_char_format = QTextCharFormat()
|
40
|
+
text_char_format.setForeground(color)
|
41
|
+
for rule in rule_variable_dict.get("rules"):
|
42
|
+
pattern = QRegularExpression(rule)
|
43
|
+
self.highlight_rules.append((pattern, text_char_format))
|
44
|
+
else:
|
45
|
+
if syntax_extend_setting_dict.get(current_file_suffix):
|
46
|
+
for rule_variable_dict in syntax_extend_setting_dict.get("current_file_suffix").values():
|
47
|
+
color = rule_variable_dict.get("color")
|
48
|
+
text_char_format = QTextCharFormat()
|
49
|
+
text_char_format.setForeground(color)
|
50
|
+
for word in rule_variable_dict.get("words"):
|
51
|
+
pattern = QRegularExpression(rf"\b{word}\b")
|
52
|
+
self.highlight_rules.append((pattern, text_char_format))
|
53
|
+
else:
|
54
|
+
pass
|
55
|
+
|
56
|
+
def highlightBlock(self, text) -> None:
|
57
|
+
jeditor_logger.info(f"PythonHighlighter highlightBlock text: {text}")
|
58
|
+
for pattern, pattern_format in self.highlight_rules:
|
59
|
+
match_iterator = pattern.globalMatch(text)
|
60
|
+
while match_iterator.hasNext():
|
61
|
+
match = match_iterator.next()
|
62
|
+
self.setFormat(match.capturedStart(), match.capturedLength(), pattern_format)
|
@@ -181,6 +181,7 @@ class EditorMain(QMainWindow, QtStyleTools):
|
|
181
181
|
if last_file_path.is_file() and last_file_path.exists() and widget.code_save_thread is None:
|
182
182
|
init_new_auto_save_thread(str(last_file_path), widget)
|
183
183
|
widget.code_edit.setPlainText(read_file(widget.current_file)[1])
|
184
|
+
widget.code_edit.reset_highlighter()
|
184
185
|
file_is_open_manager_dict.update({str(last_file_path): str(last_file_path.name)})
|
185
186
|
widget.rename_self_tab()
|
186
187
|
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/redirect_manager/redirect_manager_class.py
RENAMED
@@ -52,8 +52,9 @@ class RedirectManager(object):
|
|
52
52
|
sys.stderr = redirect_err
|
53
53
|
default_logger = logging.getLogger("RedirectManager")
|
54
54
|
default_logger.addHandler(redirect_err)
|
55
|
+
skip_logger_list = ["JEditor", "FrontEngine", "AutomationIDE"]
|
55
56
|
for name in logging.root.manager.loggerDict.keys():
|
56
|
-
if name
|
57
|
+
if name in skip_logger_list:
|
57
58
|
continue
|
58
59
|
else:
|
59
60
|
logging.getLogger(name).addHandler(redirect_err)
|
@@ -1,39 +0,0 @@
|
|
1
|
-
from PySide6.QtCore import QRegularExpression
|
2
|
-
from PySide6.QtGui import QSyntaxHighlighter
|
3
|
-
from PySide6.QtGui import QTextCharFormat
|
4
|
-
|
5
|
-
from je_editor.pyside_ui.code.syntax.syntax_setting import syntax_word_setting_dict, syntax_rule_setting_dict
|
6
|
-
from je_editor.utils.logging.loggin_instance import jeditor_logger
|
7
|
-
|
8
|
-
|
9
|
-
class PythonHighlighter(QSyntaxHighlighter):
|
10
|
-
def __init__(self, parent=None):
|
11
|
-
jeditor_logger.info(f"Init PythonHighlighter parent: {parent}")
|
12
|
-
super().__init__(parent)
|
13
|
-
|
14
|
-
self.highlight_rules = []
|
15
|
-
|
16
|
-
# Highlight
|
17
|
-
for rule_variable_dict in syntax_word_setting_dict.values():
|
18
|
-
color = rule_variable_dict.get("color")
|
19
|
-
text_char_format = QTextCharFormat()
|
20
|
-
text_char_format.setForeground(color)
|
21
|
-
for word in rule_variable_dict.get("words"):
|
22
|
-
pattern = QRegularExpression(rf"\b{word}\b")
|
23
|
-
self.highlight_rules.append((pattern, text_char_format))
|
24
|
-
|
25
|
-
for rule_variable_dict in syntax_rule_setting_dict.values():
|
26
|
-
color = rule_variable_dict.get("color")
|
27
|
-
text_char_format = QTextCharFormat()
|
28
|
-
text_char_format.setForeground(color)
|
29
|
-
for rule in rule_variable_dict.get("rules"):
|
30
|
-
pattern = QRegularExpression(rule)
|
31
|
-
self.highlight_rules.append((pattern, text_char_format))
|
32
|
-
|
33
|
-
def highlightBlock(self, text) -> None:
|
34
|
-
jeditor_logger.info(f"PythonHighlighter highlightBlock text: {text}")
|
35
|
-
for pattern, pattern_format in self.highlight_rules:
|
36
|
-
match_iterator = pattern.globalMatch(text)
|
37
|
-
while match_iterator.hasNext():
|
38
|
-
match = match_iterator.next()
|
39
|
-
self.setFormat(match.capturedStart(), match.capturedLength(), pattern_format)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/browser/browser_download_window.py
RENAMED
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/browser/browser_serach_lineedit.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/auto_save/auto_save_manager.py
RENAMED
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/auto_save/auto_save_thread.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/plaintext_code_edit/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/shell_process/shell_exec.py
RENAMED
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/textedit_code_result/__init__.py
RENAMED
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/code/textedit_code_result/code_record.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/file_dialog/create_file_dialog.py
RENAMED
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/file_dialog/open_file_dialog.py
RENAMED
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/file_dialog/save_file_dialog.py
RENAMED
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/search_ui/search_error_box.py
RENAMED
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/dialog/search_ui/search_text_box.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/editor/editor_widget_dock.py
RENAMED
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/ipython_widget/__init__.py
RENAMED
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/ipython_widget/rich_jupyter.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/dock_menu/__init__.py
RENAMED
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/file_menu/__init__.py
RENAMED
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/help_menu/__init__.py
RENAMED
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/language_menu/__init__.py
RENAMED
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/python_env_menu/__init__.py
RENAMED
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/run_menu/__init__.py
RENAMED
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/run_menu/build_run_menu.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/style_menu/__init__.py
RENAMED
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/tab_menu/__init__.py
RENAMED
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/tab_menu/build_tab_menu.py
RENAMED
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/menu/text_menu/__init__.py
RENAMED
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/save_settings/__init__.py
RENAMED
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/pyside_ui/main_ui/save_settings/setting_utils.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/multi_language/multi_language_wrapper.py
RENAMED
File without changes
|
{je_editor-0.0.186 → je_editor-0.0.187}/je_editor/utils/multi_language/traditional_chinese.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|