Skip to content

Commit

Permalink
Merge pull request #135 from Integration-Automation/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
JE-Chen committed Sep 25, 2023
2 parents c5a0fd0 + b1c70c7 commit 44ddc09
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 18 deletions.
1 change: 1 addition & 0 deletions exe/a.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("你好")
8 changes: 8 additions & 0 deletions exe/auto_py_to_exe.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@
{
"optionDest": "datas",
"value": "C:/CodeWorkspace/je_editor/exe/venv/Lib/site-packages/debugpy;debugpy/"
},
{
"optionDest": "datas",
"value": "C:/CodeWorkspace/je_editor/venv/Lib/site-packages/parso;parso/"
},
{
"optionDest": "datas",
"value": "C:/CodeWorkspace/je_editor/venv/Lib/site-packages/jedi;jedi/"
}
],
"nonPyinstallerOptions": {
Expand Down
Binary file modified exe/jeditor_build_project.ifp
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def __init__(self, main_window: Union[EditorWidget, FullEditorWidget]):
# Jedi
self.env = None
self.check_env()
self.project = jedi.Project(str(Path.cwd()))
# Self main window (parent)
self.main_window = main_window

Expand Down Expand Up @@ -82,9 +81,8 @@ def check_env(self):
try:
if path.exists():
self.env = jedi.create_environment(str(path))
self.project = jedi.Project(str(Path.cwd()))
except Exception as error:
error.with_traceback()
raise error

def set_complete(self, list_to_complete: list) -> None:
"""
Expand Down
2 changes: 1 addition & 1 deletion je_editor/pyside_ui/main_ui/editor/editor_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,6 @@ def close(self) -> bool:
if self.code_save_thread is not None:
self.code_save_thread.still_run = False
self.code_save_thread = None
file_is_open_manager_dict.pop(self.current_file, None)
file_is_open_manager_dict.pop(str(Path(self.current_file)), None)
auto_save_manager_dict.pop(self.current_file, None)
return super().close()
1 change: 0 additions & 1 deletion je_editor/pyside_ui/main_ui/editor/editor_widget_dock.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class FullEditorWidget(QWidget):
def __init__(self, current_file: str):
super().__init__()
# Init variable
self.auto_save_thread = None
self.current_file = current_file
# Attr
self.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose)
Expand Down
17 changes: 7 additions & 10 deletions je_editor/pyside_ui/main_ui/main_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

class EditorMain(QMainWindow, QtStyleTools):

def __init__(self, debug_mode: bool = False, show_system_tray_ray: bool = True):
def __init__(self, debug_mode: bool = False, show_system_tray_ray: bool = False):
super(EditorMain, self).__init__()
# Init variable
self.file_menu = None
Expand All @@ -41,6 +41,7 @@ def __init__(self, debug_mode: bool = False, show_system_tray_ray: bool = True):
self.font_size_menu = None
self.font_menu = None
self.working_dir = None
self.show_system_tray_ray = show_system_tray_ray
# Self attr
# Read user setting first
read_user_setting()
Expand Down Expand Up @@ -85,7 +86,7 @@ def __init__(self, debug_mode: bool = False, show_system_tray_ray: bool = True):
self.icon = QIcon(str(self.icon_path))
if self.icon.isNull() is False:
self.setWindowIcon(self.icon)
if ExtendSystemTray.isSystemTrayAvailable() and show_system_tray_ray:
if ExtendSystemTray.isSystemTrayAvailable() and self.show_system_tray_ray:
self.system_tray = ExtendSystemTray(main_window=self)
self.system_tray.setIcon(self.icon)
self.system_tray.setVisible(True)
Expand Down Expand Up @@ -195,13 +196,9 @@ def go_to_new_tab(self, file_path: Path):
self.tab_widget.setCurrentWidget(widget)

def closeEvent(self, event) -> None:
if self.system_tray.isVisible():
self.hide()
event.ignore()
else:
write_user_setting()
write_user_color_setting()
super().closeEvent(event)
write_user_setting()
write_user_color_setting()
super().closeEvent(event)

def event(self, event: QEvent) -> bool:
if event.type() == QEvent.Type.ToolTip:
Expand All @@ -212,7 +209,7 @@ def event(self, event: QEvent) -> bool:

def close_tab(self, index: int):
widget = self.tab_widget.widget(index)
if widget is not None:
if widget:
widget.close()
self.tab_widget.removeTab(index)

Expand Down
2 changes: 1 addition & 1 deletion je_editor/utils/file/save/save_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def write_file(file_path: str, content: str) -> None:
try:
lock.acquire()
if file_path != "" and file_path is not None:
with open(file_path, "w+") as file_to_write:
with open(file_path, "w+", encoding="utf-8") as file_to_write:
file_to_write.write(content)
except JEditorSaveFileException:
raise JEditorSaveFileException
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "je_editor_dev"
version = "0.0.177"
version = "0.0.183"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
Expand Down
2 changes: 1 addition & 1 deletion stable.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "je_editor"
version = "0.0.163"
version = "0.0.169"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
Expand Down

0 comments on commit 44ddc09

Please sign in to comment.