je-editor 0.0.63__tar.gz → 0.0.64__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. {je_editor-0.0.63 → je_editor-0.0.64}/PKG-INFO +1 -1
  2. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/main_ui_setting/ui_setting.py +3 -0
  3. je_editor-0.0.64/je_editor/pyside_ui/syntax/python_syntax.py +97 -0
  4. je_editor-0.0.64/je_editor/utils/redirect_manager/__init__.py +0 -0
  5. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor.egg-info/PKG-INFO +1 -1
  6. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor.egg-info/SOURCES.txt +2 -0
  7. {je_editor-0.0.63 → je_editor-0.0.64}/pyproject.toml +1 -1
  8. {je_editor-0.0.63 → je_editor-0.0.64}/LICENSE +0 -0
  9. {je_editor-0.0.63 → je_editor-0.0.64}/README.md +0 -0
  10. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/__init__.py +0 -0
  11. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/__main__.py +0 -0
  12. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/__init__.py +0 -0
  13. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/actions/__init__.py +0 -0
  14. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/auto_save/__init__.py +0 -0
  15. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/auto_save/auto_save_thread.py +0 -0
  16. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/code_process/__init__.py +0 -0
  17. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/code_process/code_exec.py +0 -0
  18. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/file_dialog/__init__.py +0 -0
  19. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/file_dialog/open_file_dialog.py +0 -0
  20. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/file_dialog/save_file_dialog.py +0 -0
  21. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/main_ui/__init__.py +0 -0
  22. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/main_ui/editor_main_ui/__init__.py +0 -0
  23. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/main_ui/editor_main_ui/main_editor.py +0 -0
  24. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/main_ui_setting/__init__.py +0 -0
  25. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/menu/__init__.py +0 -0
  26. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/menu/menu_bar/__init__.py +0 -0
  27. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/menu/menu_bar/file_menu/__init__.py +0 -0
  28. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/menu/menu_bar/file_menu/build_file_menu.py +0 -0
  29. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/menu/menu_bar/run_menu/__init__.py +0 -0
  30. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/menu/menu_bar/run_menu/build_run_menu.py +0 -0
  31. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/menu/menu_bar/set_menu_bar.py +0 -0
  32. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/shell_process/__init__.py +0 -0
  33. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/shell_process/shell_exec.py +0 -0
  34. {je_editor-0.0.63/je_editor/pyside_ui/treeview → je_editor-0.0.64/je_editor/pyside_ui/syntax}/__init__.py +0 -0
  35. {je_editor-0.0.63/je_editor/pyside_ui/treeview/project_treeview → je_editor-0.0.64/je_editor/pyside_ui/treeview}/__init__.py +0 -0
  36. {je_editor-0.0.63/je_editor/utils/file → je_editor-0.0.64/je_editor/pyside_ui/treeview/project_treeview}/__init__.py +0 -0
  37. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/pyside_ui/treeview/project_treeview/set_project_treeview.py +0 -0
  38. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/start_editor.py +0 -0
  39. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/utils/__init__.py +0 -0
  40. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/utils/exception/__init__.py +0 -0
  41. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/utils/exception/exception_tags.py +0 -0
  42. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/utils/exception/exceptions.py +0 -0
  43. {je_editor-0.0.63/je_editor/utils/project → je_editor-0.0.64/je_editor/utils/file}/__init__.py +0 -0
  44. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/utils/file/open/__init__.py +0 -0
  45. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/utils/file/open/open_file.py +0 -0
  46. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/utils/file/save/__init__.py +0 -0
  47. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/utils/file/save/save_file.py +0 -0
  48. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/utils/json_format/__init__.py +0 -0
  49. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/utils/json_format/json_process.py +0 -0
  50. {je_editor-0.0.63/je_editor/utils/redirect_manager → je_editor-0.0.64/je_editor/utils/project}/__init__.py +0 -0
  51. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/utils/project/create_project.py +0 -0
  52. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor/utils/redirect_manager/redirect_manager_class.py +0 -0
  53. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor.egg-info/dependency_links.txt +0 -0
  54. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor.egg-info/requires.txt +0 -0
  55. {je_editor-0.0.63 → je_editor-0.0.64}/je_editor.egg-info/top_level.txt +0 -0
  56. {je_editor-0.0.63 → je_editor-0.0.64}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: je_editor
3
- Version: 0.0.63
3
+ Version: 0.0.64
4
4
  Summary: Simple editor for ITE
5
5
  Author-email: JE-Chen <zenmailman@gmail.com>
6
6
  License: MIT
@@ -1,6 +1,8 @@
1
1
  from PySide6 import QtGui
2
2
  from PySide6.QtWidgets import QMainWindow, QScrollArea, QPlainTextEdit, QGridLayout, QWidget, QTextEdit
3
3
 
4
+ from je_editor.pyside_ui.syntax.python_syntax import PythonHighlighter
5
+
4
6
 
5
7
  def set_ui(ui_we_want_to_set: QMainWindow):
6
8
  # set qt window
@@ -14,6 +16,7 @@ def set_ui(ui_we_want_to_set: QMainWindow):
14
16
  ui_we_want_to_set.code_edit.setLineWrapMode(ui_we_want_to_set.code_edit.LineWrapMode.NoWrap)
15
17
  ui_we_want_to_set.code_edit.setTabStopDistance(
16
18
  QtGui.QFontMetricsF(ui_we_want_to_set.code_edit.font()).horizontalAdvance(' ') * 4)
19
+ PythonHighlighter(ui_we_want_to_set.code_edit.document())
17
20
  ui_we_want_to_set.code_result = QTextEdit()
18
21
  ui_we_want_to_set.code_result.setLineWrapMode(ui_we_want_to_set.code_result.LineWrapMode.NoWrap)
19
22
  ui_we_want_to_set.code_result.setReadOnly(True)
@@ -0,0 +1,97 @@
1
+ from PySide6.QtCore import QRegularExpression
2
+ from PySide6.QtGui import QColor
3
+ from PySide6.QtGui import QFont
4
+ from PySide6.QtGui import QSyntaxHighlighter
5
+ from PySide6.QtGui import QTextCharFormat
6
+
7
+ keywords = [
8
+ "False", "None", "True", "and", "as", "assert", "async",
9
+ "await", "break", "class", "continue", "def", "del",
10
+ "elif", "else", "except", "finally", "for", "from",
11
+ "global", "if", "import", "in", "is", "lambda", "nonlocal",
12
+ "not", "or", "pass", "raise", "return", "try", "while", "with", "yield"
13
+ ]
14
+
15
+ builtins_keyword = [
16
+ "abs", "aiter", "all", "any", "anext", "ascii",
17
+ "bin", "bool", "breakpoint", "bytearray", "bytes",
18
+ "callable", "chr", "classmethod", "compile", "complex",
19
+ "delattr", "dict", "dir", "divmod",
20
+ "enumerate", "eval", "exec",
21
+ "filter", "float", "format", "frozenset",
22
+ "getattr", "globals",
23
+ "hasattr", "hash", "help", "hex",
24
+ "id", "input", "int", "isinstance", "issubclass", "iter",
25
+ "len", "list", "locals",
26
+ "map", "max", "memoryview", "min",
27
+ "next",
28
+ "object", "oct", "open", "ord",
29
+ "pow", "print", "property",
30
+ "range", "repr", "reversed", "round",
31
+ "set", "setattr", "slice", "sorted", "staticmethod",
32
+ "str", "sum", "super",
33
+ "tuple", "type",
34
+ "vars",
35
+ "zip",
36
+ "__import__"
37
+ ]
38
+
39
+ string_rule = [
40
+ r"'[^'\\]*(\\.[^'\\]*)*'", # Singel
41
+ r'"[^"\\]*(\\.[^"\\]*)*"' # Double
42
+ ]
43
+
44
+ number_rule = [
45
+ r"\b[+-]?[0-9]+[lL]?\b",
46
+ r"\b[+-]?0[xX][0-9A-Fa-f]+[lL]?\b",
47
+ r"\b[+-]?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\b"
48
+ ]
49
+
50
+
51
+ class PythonHighlighter(QSyntaxHighlighter):
52
+ def __init__(self, parent=None):
53
+ super().__init__(parent)
54
+
55
+ self.highlight_rules = []
56
+
57
+ text_char_format = QTextCharFormat()
58
+ text_char_format.setForeground(QColor(255, 212, 102))
59
+ text_char_format.setFontWeight(QFont.Bold)
60
+ for word in keywords:
61
+ pattern = QRegularExpression(rf"\b{word}\b")
62
+ self.highlight_rules.append((pattern, text_char_format))
63
+
64
+ text_char_format = QTextCharFormat()
65
+ text_char_format.setForeground(QColor(0, 153, 0))
66
+ for rule in string_rule:
67
+ pattern = QRegularExpression(rule)
68
+ self.highlight_rules.append((pattern, text_char_format))
69
+
70
+ text_char_format = QTextCharFormat()
71
+ text_char_format.setForeground(QColor(0, 128, 255))
72
+ for rule in number_rule:
73
+ pattern = QRegularExpression(rule)
74
+ self.highlight_rules.append((pattern, text_char_format))
75
+
76
+ text_char_format = QTextCharFormat()
77
+ text_char_format.setForeground(QColor(0, 0, 255))
78
+ for rule in builtins_keyword:
79
+ pattern = QRegularExpression(rule)
80
+ self.highlight_rules.append((pattern, text_char_format))
81
+
82
+ text_char_format = QTextCharFormat()
83
+ text_char_format.setForeground(QColor(80, 80, 80))
84
+ pattern = QRegularExpression(r"#[^\n]*")
85
+ self.highlight_rules.append((pattern, text_char_format))
86
+
87
+ text_char_format = QTextCharFormat()
88
+ text_char_format.setForeground(QColor(204, 0, 204))
89
+ pattern = QRegularExpression(r"\bself\b")
90
+ self.highlight_rules.append((pattern, text_char_format))
91
+
92
+ def highlightBlock(self, text):
93
+ for pattern, format in self.highlight_rules:
94
+ match_iterator = pattern.globalMatch(text)
95
+ while match_iterator.hasNext():
96
+ match = match_iterator.next()
97
+ self.setFormat(match.capturedStart(), match.capturedLength(), format)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: je-editor
3
- Version: 0.0.63
3
+ Version: 0.0.64
4
4
  Summary: Simple editor for ITE
5
5
  Author-email: JE-Chen <zenmailman@gmail.com>
6
6
  License: MIT
@@ -32,6 +32,8 @@ je_editor/pyside_ui/menu/menu_bar/run_menu/__init__.py
32
32
  je_editor/pyside_ui/menu/menu_bar/run_menu/build_run_menu.py
33
33
  je_editor/pyside_ui/shell_process/__init__.py
34
34
  je_editor/pyside_ui/shell_process/shell_exec.py
35
+ je_editor/pyside_ui/syntax/__init__.py
36
+ je_editor/pyside_ui/syntax/python_syntax.py
35
37
  je_editor/pyside_ui/treeview/__init__.py
36
38
  je_editor/pyside_ui/treeview/project_treeview/__init__.py
37
39
  je_editor/pyside_ui/treeview/project_treeview/set_project_treeview.py
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "je_editor"
9
- version = "0.0.63"
9
+ version = "0.0.64"
10
10
  authors = [
11
11
  { name = "JE-Chen", email = "zenmailman@gmail.com" },
12
12
  ]
File without changes
File without changes
File without changes