Skip to content

Commit 49f9295

Browse files
committed
Refactor
1 parent 2b6697e commit 49f9295

File tree

5 files changed

+12
-16
lines changed

5 files changed

+12
-16
lines changed

dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ frontengine
22
PySide6
33
sphinx
44
twine
5-
je_editor_dev
5+
build

je_editor/pyside_ui/code/code_format/pep8_format.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ def __init__(self, filename: str, **kwargs):
2424
self.error_list: list = list()
2525

2626
def replace_report_error(self, line_number, offset, text, check):
27-
if text.startswith("W191"):
28-
pass
29-
else:
27+
if not text.startswith("W191"):
3028
self.error_list.append(f"{text} on line: {line_number}, offset: {offset}")
3129

3230
def check_all_format(self, expected=None, line_offset=0) -> int:

je_editor/pyside_ui/code/code_process/code_exec.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ def exec_code(self, exec_file_name, exec_prefix: Union[str, list] = None) -> Non
130130
if self.process is not None:
131131
self.process.terminate()
132132

133+
def full_exit_program(self):
134+
self.timer.stop()
135+
self.exit_program()
136+
self.main_window.exec_program = None
137+
133138
def pull_text(self) -> None:
134139
# Pull text from queue and put in code result area
135140
try:
@@ -149,13 +154,9 @@ def pull_text(self) -> None:
149154
except queue.Empty:
150155
pass
151156
if self.process.returncode == 0:
152-
self.timer.stop()
153-
self.exit_program()
154-
self.main_window.exec_program = None
157+
self.full_exit_program()
155158
elif self.process.returncode is not None:
156-
self.timer.stop()
157-
self.exit_program()
158-
self.main_window.exec_program = None
159+
self.full_exit_program()
159160
if self.still_run_program:
160161
# poll return code
161162
self.process.poll()

je_editor/pyside_ui/code/plaintext_code_edit/code_edit_plaintext.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,8 @@ def __init__(self, main_window: Union[EditorWidget, FullEditorWidget]):
7777

7878
def check_env(self):
7979
path = venv_check()
80-
try:
81-
if path.exists():
82-
self.env = jedi.create_environment(str(path))
83-
except Exception as error:
84-
raise error
80+
if path.exists():
81+
self.env = jedi.create_environment(str(path))
8582

8683
def set_complete(self, list_to_complete: list) -> None:
8784
"""

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "je_editor_dev"
9-
version = "0.0.193"
9+
version = "0.0.194"
1010
authors = [
1111
{ name = "JE-Chen", email = "[email protected]" },
1212
]

0 commit comments

Comments
 (0)