je-editor 0.0.193__py3-none-any.whl → 0.0.194__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- je_editor/pyside_ui/code/auto_save/auto_save_thread.py +5 -1
- je_editor/pyside_ui/code/code_process/code_exec.py +1 -1
- je_editor/pyside_ui/code/shell_process/shell_exec.py +1 -1
- je_editor/pyside_ui/main_ui/editor/editor_widget.py +15 -14
- je_editor/pyside_ui/main_ui/main_editor.py +2 -2
- je_editor/pyside_ui/main_ui/menu/check_style_menu/build_check_style_menu.py +17 -0
- je_editor/utils/multi_language/english.py +2 -1
- je_editor/utils/multi_language/traditional_chinese.py +2 -1
- {je_editor-0.0.193.dist-info → je_editor-0.0.194.dist-info}/METADATA +1 -1
- {je_editor-0.0.193.dist-info → je_editor-0.0.194.dist-info}/RECORD +13 -13
- {je_editor-0.0.193.dist-info → je_editor-0.0.194.dist-info}/LICENSE +0 -0
- {je_editor-0.0.193.dist-info → je_editor-0.0.194.dist-info}/WHEEL +0 -0
- {je_editor-0.0.193.dist-info → je_editor-0.0.194.dist-info}/top_level.txt +0 -0
@@ -26,6 +26,7 @@ class CodeEditSaveThread(Thread):
|
|
26
26
|
self.still_run: bool = True
|
27
27
|
# set daemon
|
28
28
|
self.daemon = True
|
29
|
+
self.skip_this_round: bool = False
|
29
30
|
|
30
31
|
def run(self) -> None:
|
31
32
|
"""
|
@@ -37,6 +38,9 @@ class CodeEditSaveThread(Thread):
|
|
37
38
|
while path.is_file() and self.editor is not None:
|
38
39
|
time.sleep(5)
|
39
40
|
if self.still_run:
|
40
|
-
|
41
|
+
if self.skip_this_round:
|
42
|
+
pass
|
43
|
+
else:
|
44
|
+
write_file(self.file, self.editor.toPlainText())
|
41
45
|
else:
|
42
46
|
break
|
@@ -131,7 +131,7 @@ class ExecManager(object):
|
|
131
131
|
# start tkinter_ui update
|
132
132
|
# start timer
|
133
133
|
self.timer = QTimer(self.main_window)
|
134
|
-
self.timer.setInterval(
|
134
|
+
self.timer.setInterval(10)
|
135
135
|
self.timer.timeout.connect(self.pull_text)
|
136
136
|
self.timer.start()
|
137
137
|
except Exception as error:
|
@@ -112,7 +112,7 @@ class ShellManager(object):
|
|
112
112
|
self.read_program_error_output_from_thread.start()
|
113
113
|
# start timer
|
114
114
|
self.timer = QTimer(self.main_window)
|
115
|
-
self.timer.setInterval(
|
115
|
+
self.timer.setInterval(10)
|
116
116
|
self.timer.timeout.connect(self.pull_text)
|
117
117
|
self.timer.start()
|
118
118
|
except Exception as error:
|
@@ -14,8 +14,9 @@ import pathlib
|
|
14
14
|
from pathlib import Path
|
15
15
|
from typing import Union
|
16
16
|
|
17
|
-
from PySide6.QtCore import Qt, QFileInfo, QDir
|
18
|
-
from PySide6.QtWidgets import QWidget, QGridLayout, QSplitter, QScrollArea, QFileSystemModel, QTreeView, QTabWidget
|
17
|
+
from PySide6.QtCore import Qt, QFileInfo, QDir
|
18
|
+
from PySide6.QtWidgets import QWidget, QGridLayout, QSplitter, QScrollArea, QFileSystemModel, QTreeView, QTabWidget, \
|
19
|
+
QMessageBox
|
19
20
|
|
20
21
|
from je_editor.pyside_ui.code.auto_save.auto_save_manager import auto_save_manager_dict, init_new_auto_save_thread, \
|
21
22
|
file_is_open_manager_dict
|
@@ -106,11 +107,6 @@ class EditorWidget(QWidget):
|
|
106
107
|
)
|
107
108
|
# Add to layout
|
108
109
|
self.grid_layout.addWidget(self.full_splitter)
|
109
|
-
# Check format time
|
110
|
-
self.check_format_timer = QTimer()
|
111
|
-
self.check_format_timer.setInterval(50)
|
112
|
-
self.check_format_timer.timeout.connect(self.check_file_format)
|
113
|
-
self.check_format_timer.start()
|
114
110
|
|
115
111
|
def set_project_treeview(self) -> None:
|
116
112
|
jeditor_logger.info("EditorWidget set_project_treeview")
|
@@ -154,6 +150,7 @@ class EditorWidget(QWidget):
|
|
154
150
|
jeditor_logger.info(f"EditorWidget open_an_file path: {path}")
|
155
151
|
if not self.check_is_open(path):
|
156
152
|
return False
|
153
|
+
self.code_save_thread.skip_this_round = True
|
157
154
|
file, file_content = read_file(str(path))
|
158
155
|
self.code_edit.setPlainText(
|
159
156
|
file_content
|
@@ -166,6 +163,7 @@ class EditorWidget(QWidget):
|
|
166
163
|
init_new_auto_save_thread(self.current_file, self)
|
167
164
|
else:
|
168
165
|
self.code_save_thread.file = self.current_file
|
166
|
+
self.code_save_thread.skip_this_round = False
|
169
167
|
self.rename_self_tab()
|
170
168
|
return True
|
171
169
|
|
@@ -185,21 +183,24 @@ class EditorWidget(QWidget):
|
|
185
183
|
self.setObjectName(str(Path(self.current_file)))
|
186
184
|
|
187
185
|
def check_file_format(self):
|
188
|
-
jeditor_logger.info("EditorWidget check_file_format")
|
189
186
|
if self.current_file:
|
190
|
-
|
187
|
+
jeditor_logger.info("EditorWidget check_file_format")
|
188
|
+
suffix_checker = Path(self.current_file).suffix
|
189
|
+
if suffix_checker == ".py":
|
191
190
|
self.checker = PEP8FormatChecker(self.current_file)
|
192
|
-
elif self.checker.current_file != self.current_file:
|
193
|
-
self.checker = PEP8FormatChecker(self.current_file)
|
194
|
-
else:
|
195
191
|
self.checker.check_all_format()
|
196
|
-
self.format_check_result.
|
192
|
+
self.format_check_result.setPlainText("")
|
197
193
|
for error in self.checker.error_list:
|
198
194
|
self.format_check_result.append(error)
|
195
|
+
self.checker.error_list.clear()
|
196
|
+
else:
|
197
|
+
message_box = QMessageBox()
|
198
|
+
message_box.setText(
|
199
|
+
language_wrapper.language_word_dict.get("python_format_checker_only_support_python_message"))
|
200
|
+
message_box.exec_()
|
199
201
|
|
200
202
|
def close(self) -> bool:
|
201
203
|
jeditor_logger.info("EditorWidget close")
|
202
|
-
self.check_format_timer.stop()
|
203
204
|
if self.code_save_thread is not None:
|
204
205
|
self.code_save_thread.still_run = False
|
205
206
|
self.code_save_thread = None
|
@@ -79,7 +79,7 @@ class EditorMain(QMainWindow, QtStyleTools):
|
|
79
79
|
self.tab_widget.tabCloseRequested.connect(self.close_tab)
|
80
80
|
# Timer to redirect error or message
|
81
81
|
self.redirect_timer = QTimer(self)
|
82
|
-
self.redirect_timer.setInterval(
|
82
|
+
self.redirect_timer.setInterval(10)
|
83
83
|
self.redirect_timer.start()
|
84
84
|
self.setWindowTitle(language_wrapper.language_word_dict.get("application_name"))
|
85
85
|
self.setToolTip(language_wrapper.language_word_dict.get("application_name"))
|
@@ -100,7 +100,7 @@ class EditorMain(QMainWindow, QtStyleTools):
|
|
100
100
|
redirect_manager_instance.set_redirect()
|
101
101
|
# Timer to redirect error or message
|
102
102
|
self.redirect_timer = QTimer(self)
|
103
|
-
self.redirect_timer.setInterval(
|
103
|
+
self.redirect_timer.setInterval(10)
|
104
104
|
self.redirect_timer.timeout.connect(self.redirect)
|
105
105
|
self.redirect_timer.start()
|
106
106
|
# TAB Add
|
@@ -39,6 +39,16 @@ def set_check_menu(ui_we_want_to_set: EditorMain) -> None:
|
|
39
39
|
)
|
40
40
|
)
|
41
41
|
ui_we_want_to_set.check_menu.addAction(ui_we_want_to_set.check_menu.reformat_json_action)
|
42
|
+
# Python formate check
|
43
|
+
ui_we_want_to_set.check_menu.check_python_format = QAction(
|
44
|
+
language_wrapper.language_word_dict.get("python_format_checker"))
|
45
|
+
ui_we_want_to_set.check_menu.check_python_format.setShortcut("Ctrl+Alt+p")
|
46
|
+
ui_we_want_to_set.check_menu.check_python_format.triggered.connect(
|
47
|
+
lambda: check_python_format(
|
48
|
+
ui_we_want_to_set
|
49
|
+
)
|
50
|
+
)
|
51
|
+
ui_we_want_to_set.check_menu.addAction(ui_we_want_to_set.check_menu.check_python_format)
|
42
52
|
|
43
53
|
|
44
54
|
def yapf_check_python_code(ui_we_want_to_set: EditorMain) -> None:
|
@@ -62,3 +72,10 @@ def reformat_json_text(ui_we_want_to_set: EditorMain) -> None:
|
|
62
72
|
code_text = widget.code_edit.toPlainText()
|
63
73
|
widget.code_result.setPlainText("")
|
64
74
|
widget.code_edit.setPlainText(reformat_json(code_text))
|
75
|
+
|
76
|
+
|
77
|
+
def check_python_format(ui_we_want_to_set: EditorMain) -> None:
|
78
|
+
jeditor_logger.info(f"build_check_style_menu.py check_python_format ui_we_want_to_set: {ui_we_want_to_set}")
|
79
|
+
widget = ui_we_want_to_set.tab_widget.currentWidget()
|
80
|
+
if isinstance(widget, EditorWidget):
|
81
|
+
widget.check_file_format()
|
@@ -25,8 +25,9 @@ english_word_dict = {
|
|
25
25
|
# Check Code Style Menu
|
26
26
|
"check_code_style_menu_label": "Check Code Style",
|
27
27
|
"yapf_reformat_label": "yapf",
|
28
|
-
"
|
28
|
+
"python_format_checker": "Python format check",
|
29
29
|
"reformat_json_label": "Reformat JSON",
|
30
|
+
"python_format_checker_only_support_python_message": "Only support python file",
|
30
31
|
# Dock Menu
|
31
32
|
"dock_menu_label": "Dock",
|
32
33
|
"dock_browser_label": "New Dock Browser",
|
@@ -25,7 +25,8 @@ traditional_chinese_word_dict = {
|
|
25
25
|
# Check Code Style Menu
|
26
26
|
"check_code_style_menu_label": "程式碼格式檢查器",
|
27
27
|
"yapf_reformat_label": "yapf",
|
28
|
-
"
|
28
|
+
"python_format_checker": "Python 格式檢查",
|
29
|
+
"python_format_checker_only_support_python_message": "只支援 Python 檔案",
|
29
30
|
"reformat_json_label": "重新格式化 JSON",
|
30
31
|
# Dock Menu
|
31
32
|
"dock_menu_label": "區域",
|
@@ -11,15 +11,15 @@ je_editor/pyside_ui/code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
11
11
|
je_editor/pyside_ui/code/running_process_manager.py,sha256=VdfdprPNlPmMySOKDOjEEl5X9IsJVPSDb0a2KDKgiQg,1008
|
12
12
|
je_editor/pyside_ui/code/auto_save/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
je_editor/pyside_ui/code/auto_save/auto_save_manager.py,sha256=hQ03TVq-c-mGku51DrjpmLtsPkVcZv4G_jaozC06Ir0,1019
|
14
|
-
je_editor/pyside_ui/code/auto_save/auto_save_thread.py,sha256=
|
14
|
+
je_editor/pyside_ui/code/auto_save/auto_save_thread.py,sha256=V_A8_4JZdHdF9e2E_rYY_paS7rnJjB8_YVPxTyHZ_QE,1662
|
15
15
|
je_editor/pyside_ui/code/code_format/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
je_editor/pyside_ui/code/code_format/pep8_format.py,sha256=zrCkUdz2SG4bnMSkXfccvpHAmUOxXLedSBxL_nkdaoE,3574
|
17
17
|
je_editor/pyside_ui/code/code_process/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
|
-
je_editor/pyside_ui/code/code_process/code_exec.py,sha256=
|
18
|
+
je_editor/pyside_ui/code/code_process/code_exec.py,sha256=mdkHe2MBBvgZbRjmSRgcu9KEFG_d0oyPWedYFUCZaxU,9840
|
19
19
|
je_editor/pyside_ui/code/plaintext_code_edit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20
20
|
je_editor/pyside_ui/code/plaintext_code_edit/code_edit_plaintext.py,sha256=lcwmBemFenH-uDGe6fo70MS47emzPFgy9XL7cipwryY,14249
|
21
21
|
je_editor/pyside_ui/code/shell_process/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
|
-
je_editor/pyside_ui/code/shell_process/shell_exec.py,sha256=
|
22
|
+
je_editor/pyside_ui/code/shell_process/shell_exec.py,sha256=WpWORZ-1T4G_SdnJ4K_6THycNOpQbsIFgjSQFQOJ_1M,8730
|
23
23
|
je_editor/pyside_ui/code/syntax/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
24
|
je_editor/pyside_ui/code/syntax/python_syntax.py,sha256=iGXvecWuHcoRyrXZ8qkM1_yhwb9Gg8wSXN0guNLevZ4,3015
|
25
25
|
je_editor/pyside_ui/code/syntax/syntax_setting.py,sha256=oaLRF_83Oa6bcAorf7AlZG0Mrt4FmsK7b4aA-LS_bRo,2284
|
@@ -34,11 +34,11 @@ je_editor/pyside_ui/dialog/search_ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
|
|
34
34
|
je_editor/pyside_ui/dialog/search_ui/search_error_box.py,sha256=GzMXMnIL1k8ZwG3A2a_oMgiUiXXqd7HKW45YlVlL_eo,1168
|
35
35
|
je_editor/pyside_ui/dialog/search_ui/search_text_box.py,sha256=H2MbC-RGpKg9TzjV4MZj7Bw7qs9a9E4cjA4GI5zsv4U,1154
|
36
36
|
je_editor/pyside_ui/main_ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
|
-
je_editor/pyside_ui/main_ui/main_editor.py,sha256=
|
37
|
+
je_editor/pyside_ui/main_ui/main_editor.py,sha256=S2NOZ7NaLtDM-sesxcPaN_FAYu69e92ZkKdBUILY1PM,11062
|
38
38
|
je_editor/pyside_ui/main_ui/dock/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
39
39
|
je_editor/pyside_ui/main_ui/dock/destroy_dock.py,sha256=MTN45BykNm6FA4gMW7gI4Kr9orTdcxVTm7mch3DUhaw,604
|
40
40
|
je_editor/pyside_ui/main_ui/editor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
41
|
-
je_editor/pyside_ui/main_ui/editor/editor_widget.py,sha256=
|
41
|
+
je_editor/pyside_ui/main_ui/editor/editor_widget.py,sha256=fTNJuho5AbPojogNGyQ4KspJ5YZwGpk6rcZ2TLjpYRY,10039
|
42
42
|
je_editor/pyside_ui/main_ui/editor/editor_widget_dock.py,sha256=6oDf0pKx0sThlk_Qz0gduPIpasPqib6OYnMnQ4FRXFo,1930
|
43
43
|
je_editor/pyside_ui/main_ui/editor/process_input.py,sha256=zj29E3He5_PD23HnIaDQ1vn3LWRECXTf8P7MWsX73k0,3401
|
44
44
|
je_editor/pyside_ui/main_ui/ipython_widget/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -46,7 +46,7 @@ je_editor/pyside_ui/main_ui/ipython_widget/rich_jupyter.py,sha256=LKbMbgpstsk_Ei
|
|
46
46
|
je_editor/pyside_ui/main_ui/menu/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
47
47
|
je_editor/pyside_ui/main_ui/menu/set_menu_bar.py,sha256=I12DXLyRO4cKe17fQY-QDazKEIh9W36LNV1aKUw47MU,1823
|
48
48
|
je_editor/pyside_ui/main_ui/menu/check_style_menu/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
49
|
-
je_editor/pyside_ui/main_ui/menu/check_style_menu/build_check_style_menu.py,sha256=
|
49
|
+
je_editor/pyside_ui/main_ui/menu/check_style_menu/build_check_style_menu.py,sha256=1wD6FI21Dw3IcQONuTkHP9rUPGwY70OvCtSc-ZcTKMk,3793
|
50
50
|
je_editor/pyside_ui/main_ui/menu/dock_menu/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
51
51
|
je_editor/pyside_ui/main_ui/menu/dock_menu/build_dock_menu.py,sha256=IBRpoZxsyrbeWdz86KNyfmkwa-q4_tThf9IpCy-Aqa0,4983
|
52
52
|
je_editor/pyside_ui/main_ui/menu/file_menu/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -94,15 +94,15 @@ je_editor/utils/json_format/json_process.py,sha256=tszo48OnVivVkuuPrl-FtGaaq-1YO
|
|
94
94
|
je_editor/utils/logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
95
95
|
je_editor/utils/logging/loggin_instance.py,sha256=OFdWgra201B4f1vDM35M9L-47DK-8j-5HQEAq_ySSKM,841
|
96
96
|
je_editor/utils/multi_language/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
97
|
-
je_editor/utils/multi_language/english.py,sha256=
|
97
|
+
je_editor/utils/multi_language/english.py,sha256=pYw9Fer07j7Dn54JIo0M5feVAuT7er8hXYnqYP6_DAg,5879
|
98
98
|
je_editor/utils/multi_language/multi_language_wrapper.py,sha256=_MtYrE51poQ1p_iWvT2eg_604uj6IsiBgGpifWpYLGc,1050
|
99
|
-
je_editor/utils/multi_language/traditional_chinese.py,sha256=
|
99
|
+
je_editor/utils/multi_language/traditional_chinese.py,sha256=RR_U9zyYWNoCBxZ2xH3uQgkeVZglz_E1jERaskth3Sk,5912
|
100
100
|
je_editor/utils/redirect_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
101
101
|
je_editor/utils/redirect_manager/redirect_manager_class.py,sha256=RsLRbhBy_YyiwTN5g0YkoobI-BvSdZgX0Ot53nrHm7g,2174
|
102
102
|
je_editor/utils/venv_check/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
103
103
|
je_editor/utils/venv_check/check_venv.py,sha256=oCrMdue4NYUUGrVifh_iHFwIgxVx9azYN4jz3Xiulgg,999
|
104
|
-
je_editor-0.0.
|
105
|
-
je_editor-0.0.
|
106
|
-
je_editor-0.0.
|
107
|
-
je_editor-0.0.
|
108
|
-
je_editor-0.0.
|
104
|
+
je_editor-0.0.194.dist-info/LICENSE,sha256=KMhUHh6pnIUvmXDW-49L_Sz63bqkOlPDqsecaqKiitU,1091
|
105
|
+
je_editor-0.0.194.dist-info/METADATA,sha256=wdJrQJtI1SQWLCPsVhC6MNujvM_d3fv_UwGAM6MdYcs,3338
|
106
|
+
je_editor-0.0.194.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
107
|
+
je_editor-0.0.194.dist-info/top_level.txt,sha256=_9YA7BgxpkmdLs-5V_UQILxClcMRgPyG1a3qaE-Bkcs,10
|
108
|
+
je_editor-0.0.194.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|