From f61e42600315a20acaff26606ac9b9e931985c64 Mon Sep 17 00:00:00 2001 From: JE-Chen <33644111+JE-Chen@users.noreply.github.com> Date: Sun, 24 Sep 2023 01:13:09 +0800 Subject: [PATCH 1/3] Update --- stable.toml => dev.toml | 11 +++++------ exe/auto_py_to_exe.json | 8 ++++++++ exe/jeditor_build_project.ifp | Bin 7132 -> 11023 bytes .../code_edit_plaintext.py | 4 +--- je_editor/pyside_ui/main_ui/main_editor.py | 15 ++++++--------- pyproject.toml | 11 ++++++----- 6 files changed, 26 insertions(+), 23 deletions(-) rename stable.toml => dev.toml (88%) diff --git a/stable.toml b/dev.toml similarity index 88% rename from stable.toml rename to dev.toml index f82f5c6..6e20b6c 100644 --- a/stable.toml +++ b/dev.toml @@ -1,12 +1,12 @@ -# Rename to build stable version -# This is stable version +# Rename to build dev version +# This is dev version [build-system] -requires = ["setuptools>=61.0"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] -name = "je_editor" -version = "0.0.163" +name = "je_editor_dev" +version = "0.0.180" authors = [ { name = "JE-Chen", email = "jechenmailman@gmail.com" }, ] @@ -26,7 +26,6 @@ classifiers = [ "Operating System :: OS Independent" ] - [project.urls] Homepage = "https://github.com/JE-Chen/je_editor" Documentation = "https://je-editor.readthedocs.io/en/latest/" diff --git a/exe/auto_py_to_exe.json b/exe/auto_py_to_exe.json index 07cbbf1..c311dc6 100644 --- a/exe/auto_py_to_exe.json +++ b/exe/auto_py_to_exe.json @@ -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": { diff --git a/exe/jeditor_build_project.ifp b/exe/jeditor_build_project.ifp index b3bc6e88d69d22514c9a2dbd0044623d6e58d0c6..bc1669764325e6b3f989f8f74681533ea6a29ec6 100644 GIT binary patch delta 1395 zcmZ8gJ8KkC6egHtpRO~3 zno7$APGPMe*eHnqK*YjMw6w6$#zM5P_ujjin@4q-^PTgZ?|kRXx68bREVwOP3#f|ojMwlRSk{y$T9+HW9&MZr=LC^lvR{R zDsO%@iiOLbP1#%_WFMg4f2(ijlD6VL&c~b;4N3Zm7i5xUnCjHAuv& zFcX^+v-<%Z1pN3I?8YiWso%AHvmM|zbxh^k64vPg;QSR2`nAs_-eb1jFe$Fw<3dnXZZ6 zMzG=71ZzEp(IV_fMfjDT7M>ae2gEXcd%uSUkEPNjp^Bkgx@$TIS(<`0CPmz#LDqRz zkAw>5Fvyu{@G~>w(CGf>Uotl!mQD35c^Vv{!CTpR z*vnRh7glT6FjnJr0u{g0U(U$zxw~d6H^$(>7}vo6Ahdvg}h$#-bK- zq_ud{s_bNa9 None: """ diff --git a/je_editor/pyside_ui/main_ui/main_editor.py b/je_editor/pyside_ui/main_ui/main_editor.py index 7ccefda..9d5c1fb 100644 --- a/je_editor/pyside_ui/main_ui/main_editor.py +++ b/je_editor/pyside_ui/main_ui/main_editor.py @@ -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 @@ -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() @@ -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) @@ -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: diff --git a/pyproject.toml b/pyproject.toml index e5e1bc0..17f1c18 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ -# Rename to build dev version -# This is dev version +# Rename to build stable version +# This is stable version [build-system] -requires = ["setuptools"] +requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" [project] -name = "je_editor_dev" -version = "0.0.177" +name = "je_editor" +version = "0.0.166" authors = [ { name = "JE-Chen", email = "jechenmailman@gmail.com" }, ] @@ -26,6 +26,7 @@ classifiers = [ "Operating System :: OS Independent" ] + [project.urls] Homepage = "https://github.com/JE-Chen/je_editor" Documentation = "https://je-editor.readthedocs.io/en/latest/" From d0c418bbaf9a2322afe75c1a8d5938d3e69cab6a Mon Sep 17 00:00:00 2001 From: JE-Chen <33644111+JE-Chen@users.noreply.github.com> Date: Sun, 24 Sep 2023 16:37:22 +0800 Subject: [PATCH 2/3] Update version and fix path problem --- exe/jeditor_build_project.ifp | 74 +++++++++---------- .../pyside_ui/main_ui/editor/editor_widget.py | 2 +- .../main_ui/editor/editor_widget_dock.py | 1 - je_editor/pyside_ui/main_ui/main_editor.py | 2 +- pyproject.toml | 11 ++- dev.toml => stable.toml | 11 +-- 6 files changed, 50 insertions(+), 51 deletions(-) rename dev.toml => stable.toml (88%) diff --git a/exe/jeditor_build_project.ifp b/exe/jeditor_build_project.ifp index bc16697..4d20c40 100644 --- a/exe/jeditor_build_project.ifp +++ b/exe/jeditor_build_project.ifp @@ -3,7 +3,7 @@ ProjectFileVersion = 1.1 [General] Program name = jeditor -Program version = 1.0.2 +Program version = 1.0.3 Windows XP = 0 Windows Server 2003 = 0 Windows Vista = 0 @@ -78,6 +78,42 @@ Execdlls = 0 2 21 [Files/Dirs] +C:\CodeWorkspace\je_editor\output\JEditor\JEditor\libzmq-v141-mt-4_3_4-0a6f51ca.dll +513 KB +dll +C:\CodeWorkspace\je_editor\output\JEditor\JEditor\msvcp140.dll +607.4 KB +dll +C:\CodeWorkspace\je_editor\output\JEditor\JEditor\pyexpat.pyd +194.3 KB +pyd +C:\CodeWorkspace\je_editor\output\JEditor\JEditor\python3.dll +64.8 KB +dll +C:\CodeWorkspace\je_editor\output\JEditor\JEditor\python310.dll +4.3 MB +dll +C:\CodeWorkspace\je_editor\output\JEditor\JEditor\select.pyd +29.3 KB +pyd +C:\CodeWorkspace\je_editor\output\JEditor\JEditor\sqlite3.dll +1.4 MB +dll +C:\CodeWorkspace\je_editor\output\JEditor\JEditor\tcl86t.dll +1.8 MB +dll +C:\CodeWorkspace\je_editor\output\JEditor\JEditor\tk86t.dll +1.5 MB +dll +C:\CodeWorkspace\je_editor\output\JEditor\JEditor\unicodedata.pyd +1.1 MB +pyd +C:\CodeWorkspace\je_editor\output\JEditor\JEditor\VCRUNTIME140.dll +95.9 KB +dll +C:\CodeWorkspace\je_editor\output\JEditor\JEditor\VCRUNTIME140_1.dll +36.4 KB +dll C:\CodeWorkspace\je_editor\output\JEditor\JEditor\aiohttp N/A [Folder] @@ -318,42 +354,6 @@ dll C:\CodeWorkspace\je_editor\output\JEditor\JEditor\libssl-1_1.dll 688.3 KB dll -C:\CodeWorkspace\je_editor\output\JEditor\JEditor\libzmq-v141-mt-4_3_4-0a6f51ca.dll -513 KB -dll -C:\CodeWorkspace\je_editor\output\JEditor\JEditor\msvcp140.dll -607.4 KB -dll -C:\CodeWorkspace\je_editor\output\JEditor\JEditor\pyexpat.pyd -194.3 KB -pyd -C:\CodeWorkspace\je_editor\output\JEditor\JEditor\python3.dll -64.8 KB -dll -C:\CodeWorkspace\je_editor\output\JEditor\JEditor\python310.dll -4.3 MB -dll -C:\CodeWorkspace\je_editor\output\JEditor\JEditor\select.pyd -29.3 KB -pyd -C:\CodeWorkspace\je_editor\output\JEditor\JEditor\sqlite3.dll -1.4 MB -dll -C:\CodeWorkspace\je_editor\output\JEditor\JEditor\tcl86t.dll -1.8 MB -dll -C:\CodeWorkspace\je_editor\output\JEditor\JEditor\tk86t.dll -1.5 MB -dll -C:\CodeWorkspace\je_editor\output\JEditor\JEditor\unicodedata.pyd -1.1 MB -pyd -C:\CodeWorkspace\je_editor\output\JEditor\JEditor\VCRUNTIME140.dll -95.9 KB -dll -C:\CodeWorkspace\je_editor\output\JEditor\JEditor\VCRUNTIME140_1.dll -36.4 KB -dll [Licence_Begin] 1609 {\rtf1\ansi\ansicpg950\deff0\nouicompat\deflang1033\deflangfe1028{\fonttbl{\f0\fnil Arial;}} diff --git a/je_editor/pyside_ui/main_ui/editor/editor_widget.py b/je_editor/pyside_ui/main_ui/editor/editor_widget.py index 179c90f..264c782 100644 --- a/je_editor/pyside_ui/main_ui/editor/editor_widget.py +++ b/je_editor/pyside_ui/main_ui/editor/editor_widget.py @@ -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() diff --git a/je_editor/pyside_ui/main_ui/editor/editor_widget_dock.py b/je_editor/pyside_ui/main_ui/editor/editor_widget_dock.py index 3cf0556..7f908cc 100644 --- a/je_editor/pyside_ui/main_ui/editor/editor_widget_dock.py +++ b/je_editor/pyside_ui/main_ui/editor/editor_widget_dock.py @@ -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) diff --git a/je_editor/pyside_ui/main_ui/main_editor.py b/je_editor/pyside_ui/main_ui/main_editor.py index 9d5c1fb..2891f34 100644 --- a/je_editor/pyside_ui/main_ui/main_editor.py +++ b/je_editor/pyside_ui/main_ui/main_editor.py @@ -209,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) diff --git a/pyproject.toml b/pyproject.toml index 17f1c18..8866c87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ -# Rename to build stable version -# This is stable version +# Rename to build dev version +# This is dev version [build-system] -requires = ["setuptools>=61.0"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] -name = "je_editor" -version = "0.0.166" +name = "je_editor_dev" +version = "0.0.181" authors = [ { name = "JE-Chen", email = "jechenmailman@gmail.com" }, ] @@ -26,7 +26,6 @@ classifiers = [ "Operating System :: OS Independent" ] - [project.urls] Homepage = "https://github.com/JE-Chen/je_editor" Documentation = "https://je-editor.readthedocs.io/en/latest/" diff --git a/dev.toml b/stable.toml similarity index 88% rename from dev.toml rename to stable.toml index 6e20b6c..47bed3c 100644 --- a/dev.toml +++ b/stable.toml @@ -1,12 +1,12 @@ -# Rename to build dev version -# This is dev version +# Rename to build stable version +# This is stable version [build-system] -requires = ["setuptools"] +requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" [project] -name = "je_editor_dev" -version = "0.0.180" +name = "je_editor" +version = "0.0.167" authors = [ { name = "JE-Chen", email = "jechenmailman@gmail.com" }, ] @@ -26,6 +26,7 @@ classifiers = [ "Operating System :: OS Independent" ] + [project.urls] Homepage = "https://github.com/JE-Chen/je_editor" Documentation = "https://je-editor.readthedocs.io/en/latest/" From b1c70c7444afe86ed17565df39ef0bea35630920 Mon Sep 17 00:00:00 2001 From: JE-Chen <33644111+JE-Chen@users.noreply.github.com> Date: Mon, 25 Sep 2023 21:42:13 +0800 Subject: [PATCH 3/3] Save file as utf-8 encoding Save file as utf-8 encoding --- exe/a.py | 1 + je_editor/utils/file/save/save_file.py | 2 +- pyproject.toml | 2 +- stable.toml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 exe/a.py diff --git a/exe/a.py b/exe/a.py new file mode 100644 index 0000000..f3599d5 --- /dev/null +++ b/exe/a.py @@ -0,0 +1 @@ +print("你好") diff --git a/je_editor/utils/file/save/save_file.py b/je_editor/utils/file/save/save_file.py index 7862770..81958ec 100644 --- a/je_editor/utils/file/save/save_file.py +++ b/je_editor/utils/file/save/save_file.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 8866c87..431fc8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "je_editor_dev" -version = "0.0.181" +version = "0.0.183" authors = [ { name = "JE-Chen", email = "jechenmailman@gmail.com" }, ] diff --git a/stable.toml b/stable.toml index 47bed3c..1e67910 100644 --- a/stable.toml +++ b/stable.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "je_editor" -version = "0.0.167" +version = "0.0.169" authors = [ { name = "JE-Chen", email = "jechenmailman@gmail.com" }, ]