moleditpy 3.0.0__tar.gz → 3.0.0a2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/PKG-INFO +4 -5
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/README.md +3 -4
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/pyproject.toml +1 -1
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/src/MoleditPy.egg-info/PKG-INFO +4 -5
- moleditpy-3.0.0a2/src/MoleditPy.egg-info/SOURCES.txt +72 -0
- {moleditpy-3.0.0/src/moleditpy/utils → moleditpy-3.0.0a2/src/moleditpy}/__init__.py +4 -0
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/src/moleditpy/main.py +4 -22
- moleditpy-3.0.0/src/moleditpy/ui/sip_isdeleted_safe.py → moleditpy-3.0.0a2/src/moleditpy/modules/__init__.py +41 -35
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/about_dialog.py +5 -6
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/align_plane_dialog.py +306 -228
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/alignment_dialog.py +10 -8
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/analysis_window.py +226 -226
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/angle_dialog.py +154 -43
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/atom_item.py +39 -58
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/bond_item.py +528 -529
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/bond_length_dialog.py +166 -62
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/calculation_worker.py +970 -984
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/color_settings_dialog.py +404 -454
- {moleditpy-3.0.0/src/moleditpy/utils → moleditpy-3.0.0a2/src/moleditpy/modules}/constants.py +1 -1
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/constrained_optimization_dialog.py +27 -45
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/custom_interactor_style.py +107 -145
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/custom_qt_interactor.py +97 -97
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/dialog_3d_picking_mixin.py +210 -229
- moleditpy-3.0.0a2/src/moleditpy/modules/dihedral_dialog.py +544 -0
- moleditpy-3.0.0a2/src/moleditpy/modules/main_window.py +107 -0
- moleditpy-3.0.0/src/moleditpy/ui/app_state.py → moleditpy-3.0.0a2/src/moleditpy/modules/main_window_app_state.py +306 -263
- moleditpy-3.0.0a2/src/moleditpy/modules/main_window_compute.py +887 -0
- moleditpy-3.0.0a2/src/moleditpy/modules/main_window_dialog_manager.py +468 -0
- moleditpy-3.0.0/src/moleditpy/ui/edit_3d_logic.py → moleditpy-3.0.0a2/src/moleditpy/modules/main_window_edit_3d.py +46 -95
- moleditpy-3.0.0/src/moleditpy/ui/edit_actions_logic.py → moleditpy-3.0.0a2/src/moleditpy/modules/main_window_edit_actions.py +379 -504
- moleditpy-3.0.0/src/moleditpy/ui/export_logic.py → moleditpy-3.0.0a2/src/moleditpy/modules/main_window_export.py +169 -186
- moleditpy-3.0.0/src/moleditpy/ui/main_window_init.py → moleditpy-3.0.0a2/src/moleditpy/modules/main_window_main_init.py +566 -731
- moleditpy-3.0.0a2/src/moleditpy/modules/main_window_molecular_parsers.py +594 -0
- moleditpy-3.0.0a2/src/moleditpy/modules/main_window_project_io.py +393 -0
- moleditpy-3.0.0/src/moleditpy/ui/string_importers.py → moleditpy-3.0.0a2/src/moleditpy/modules/main_window_string_importers.py +248 -257
- moleditpy-3.0.0a2/src/moleditpy/modules/main_window_ui_manager.py +518 -0
- moleditpy-3.0.0/src/moleditpy/ui/view_3d_logic.py → moleditpy-3.0.0a2/src/moleditpy/modules/main_window_view_3d.py +262 -503
- moleditpy-3.0.0a2/src/moleditpy/modules/main_window_view_loaders.py +282 -0
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/mirror_dialog.py +140 -140
- {moleditpy-3.0.0/src/moleditpy/core → moleditpy-3.0.0a2/src/moleditpy/modules}/mol_geometry.py +15 -240
- {moleditpy-3.0.0/src/moleditpy/core → moleditpy-3.0.0a2/src/moleditpy/modules}/molecular_data.py +66 -148
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/molecular_scene_handler.py +48 -103
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/molecule_scene.py +42 -104
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/move_group_dialog.py +216 -134
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/periodic_table_dialog.py +196 -196
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/planarize_dialog.py +242 -194
- moleditpy-3.0.0a2/src/moleditpy/modules/plugin_interface.py +230 -0
- {moleditpy-3.0.0/src/moleditpy/plugins → moleditpy-3.0.0a2/src/moleditpy/modules}/plugin_manager.py +578 -678
- {moleditpy-3.0.0/src/moleditpy/plugins → moleditpy-3.0.0a2/src/moleditpy/modules}/plugin_manager_window.py +313 -352
- moleditpy-3.0.0a2/src/moleditpy/modules/settings_dialog.py +1705 -0
- moleditpy-3.0.0a2/src/moleditpy/modules/sip_isdeleted_safe.py +17 -0
- {moleditpy-3.0.0/src/moleditpy/utils → moleditpy-3.0.0a2/src/moleditpy/modules}/system_utils.py +71 -71
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/template_preview_item.py +2 -2
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/template_preview_view.py +85 -85
- moleditpy-3.0.0a2/src/moleditpy/modules/translation_dialog.py +347 -0
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/user_template_dialog.py +712 -724
- moleditpy-3.0.0/src/MoleditPy.egg-info/SOURCES.txt +0 -82
- moleditpy-3.0.0/src/moleditpy/__init__.py +0 -20
- moleditpy-3.0.0/src/moleditpy/core/__init__.py +0 -0
- moleditpy-3.0.0/src/moleditpy/plugins/__init__.py +0 -11
- moleditpy-3.0.0/src/moleditpy/plugins/plugin_interface.py +0 -400
- moleditpy-3.0.0/src/moleditpy/ui/__init__.py +0 -25
- moleditpy-3.0.0/src/moleditpy/ui/base_picking_dialog.py +0 -126
- moleditpy-3.0.0/src/moleditpy/ui/compute_logic.py +0 -673
- moleditpy-3.0.0/src/moleditpy/ui/dialog_logic.py +0 -478
- moleditpy-3.0.0/src/moleditpy/ui/dihedral_dialog.py +0 -406
- moleditpy-3.0.0/src/moleditpy/ui/geometry_base_dialog.py +0 -113
- moleditpy-3.0.0/src/moleditpy/ui/io_logic.py +0 -1036
- moleditpy-3.0.0/src/moleditpy/ui/main_window.py +0 -100
- moleditpy-3.0.0/src/moleditpy/ui/settings_dialog.py +0 -204
- moleditpy-3.0.0/src/moleditpy/ui/settings_tabs/__init__.py +0 -11
- moleditpy-3.0.0/src/moleditpy/ui/settings_tabs/settings_2d_tab.py +0 -220
- moleditpy-3.0.0/src/moleditpy/ui/settings_tabs/settings_3d_tabs.py +0 -276
- moleditpy-3.0.0/src/moleditpy/ui/settings_tabs/settings_other_tab.py +0 -111
- moleditpy-3.0.0/src/moleditpy/ui/settings_tabs/settings_tab_base.py +0 -63
- moleditpy-3.0.0/src/moleditpy/ui/translation_dialog.py +0 -193
- moleditpy-3.0.0/src/moleditpy/ui/ui_manager.py +0 -648
- moleditpy-3.0.0/src/moleditpy/utils/default_settings.py +0 -85
- moleditpy-3.0.0/src/moleditpy/utils/sip_isdeleted_safe.py +0 -41
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/LICENSE +0 -0
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/setup.cfg +0 -0
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/src/MoleditPy.egg-info/dependency_links.txt +0 -0
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/src/MoleditPy.egg-info/entry_points.txt +0 -0
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/src/MoleditPy.egg-info/requires.txt +0 -0
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/src/MoleditPy.egg-info/top_level.txt +0 -0
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/src/moleditpy/__main__.py +0 -0
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/src/moleditpy/assets/file_icon.ico +0 -0
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/src/moleditpy/assets/icon.icns +0 -0
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/src/moleditpy/assets/icon.ico +0 -0
- {moleditpy-3.0.0 → moleditpy-3.0.0a2}/src/moleditpy/assets/icon.png +0 -0
- {moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/zoomable_view.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MoleditPy
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.0a2
|
|
4
4
|
Summary: A cross-platform, simple, and intuitive molecular structure editor built in Python. It allows 2D molecular drawing and 3D structure visualization. It supports exporting structure files for input to DFT calculation software.
|
|
5
5
|
Author-email: HiroYokoyama <titech.yoko.hiro@gmail.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -710,10 +710,10 @@ Dynamic: license-file
|
|
|
710
710
|
[](https://pypi.org/project/MoleditPy/)
|
|
711
711
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
712
712
|
[](https://github.com/HiroYokoyama/python_molecular_editor/actions)
|
|
713
|
-

|
|
714
|
+

|
|
715
715
|

|
|
716
|
-

|
|
717
717
|
[](https://pepy.tech/projects/moleditpy)
|
|
718
718
|
|
|
719
719
|
[🇯🇵 日本語 (Japanese)](#japanese)
|
|
@@ -834,7 +834,6 @@ moleditpy
|
|
|
834
834
|
* **GUI and 2D Drawing (PyQt6):** The editor is built on a `QGraphicsScene`, where custom `AtomItem` and `BondItem` objects are interactively manipulated. The Undo/Redo feature is implemented by serializing the application state.
|
|
835
835
|
* **Chemical Calculations (RDKit / Open Babel):** RDKit is used to generate molecule objects from 2D data, perform 3D coordinate generation, and calculate properties. Open Babel serves as a fallback for 3D conversion. All heavy computations are run on a separate `QThread` to keep the GUI responsive.
|
|
836
836
|
* **3D Visualization (PyVista / pyvistaqt):** 3D rendering is achieved by generating PyVista meshes (spheres and cylinders) from RDKit conformer coordinates. A custom `vtkInteractorStyle` enables direct drag-and-drop editing of atoms in the 3D view.
|
|
837
|
-
* **Modular Architecture:** The codebase is organized into dedicated packages for `core` logic, `ui` components, and `utils`. The main application logic is decomposed into reusable mixins, ensuring long-term maintainability and easier verification.
|
|
838
837
|
|
|
839
838
|
## License
|
|
840
839
|
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
[](https://pypi.org/project/MoleditPy/)
|
|
7
7
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
8
8
|
[](https://github.com/HiroYokoyama/python_molecular_editor/actions)
|
|
9
|
-

|
|
10
|
+

|
|
11
11
|

|
|
12
|
-

|
|
13
13
|
[](https://pepy.tech/projects/moleditpy)
|
|
14
14
|
|
|
15
15
|
[🇯🇵 日本語 (Japanese)](#japanese)
|
|
@@ -130,7 +130,6 @@ moleditpy
|
|
|
130
130
|
* **GUI and 2D Drawing (PyQt6):** The editor is built on a `QGraphicsScene`, where custom `AtomItem` and `BondItem` objects are interactively manipulated. The Undo/Redo feature is implemented by serializing the application state.
|
|
131
131
|
* **Chemical Calculations (RDKit / Open Babel):** RDKit is used to generate molecule objects from 2D data, perform 3D coordinate generation, and calculate properties. Open Babel serves as a fallback for 3D conversion. All heavy computations are run on a separate `QThread` to keep the GUI responsive.
|
|
132
132
|
* **3D Visualization (PyVista / pyvistaqt):** 3D rendering is achieved by generating PyVista meshes (spheres and cylinders) from RDKit conformer coordinates. A custom `vtkInteractorStyle` enables direct drag-and-drop editing of atoms in the 3D view.
|
|
133
|
-
* **Modular Architecture:** The codebase is organized into dedicated packages for `core` logic, `ui` components, and `utils`. The main application logic is decomposed into reusable mixins, ensuring long-term maintainability and easier verification.
|
|
134
133
|
|
|
135
134
|
## License
|
|
136
135
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MoleditPy
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.0a2
|
|
4
4
|
Summary: A cross-platform, simple, and intuitive molecular structure editor built in Python. It allows 2D molecular drawing and 3D structure visualization. It supports exporting structure files for input to DFT calculation software.
|
|
5
5
|
Author-email: HiroYokoyama <titech.yoko.hiro@gmail.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -710,10 +710,10 @@ Dynamic: license-file
|
|
|
710
710
|
[](https://pypi.org/project/MoleditPy/)
|
|
711
711
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
712
712
|
[](https://github.com/HiroYokoyama/python_molecular_editor/actions)
|
|
713
|
-

|
|
714
|
+

|
|
715
715
|

|
|
716
|
-

|
|
717
717
|
[](https://pepy.tech/projects/moleditpy)
|
|
718
718
|
|
|
719
719
|
[🇯🇵 日本語 (Japanese)](#japanese)
|
|
@@ -834,7 +834,6 @@ moleditpy
|
|
|
834
834
|
* **GUI and 2D Drawing (PyQt6):** The editor is built on a `QGraphicsScene`, where custom `AtomItem` and `BondItem` objects are interactively manipulated. The Undo/Redo feature is implemented by serializing the application state.
|
|
835
835
|
* **Chemical Calculations (RDKit / Open Babel):** RDKit is used to generate molecule objects from 2D data, perform 3D coordinate generation, and calculate properties. Open Babel serves as a fallback for 3D conversion. All heavy computations are run on a separate `QThread` to keep the GUI responsive.
|
|
836
836
|
* **3D Visualization (PyVista / pyvistaqt):** 3D rendering is achieved by generating PyVista meshes (spheres and cylinders) from RDKit conformer coordinates. A custom `vtkInteractorStyle` enables direct drag-and-drop editing of atoms in the 3D view.
|
|
837
|
-
* **Modular Architecture:** The codebase is organized into dedicated packages for `core` logic, `ui` components, and `utils`. The main application logic is decomposed into reusable mixins, ensuring long-term maintainability and easier verification.
|
|
838
837
|
|
|
839
838
|
## License
|
|
840
839
|
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/MoleditPy.egg-info/PKG-INFO
|
|
5
|
+
src/MoleditPy.egg-info/SOURCES.txt
|
|
6
|
+
src/MoleditPy.egg-info/dependency_links.txt
|
|
7
|
+
src/MoleditPy.egg-info/entry_points.txt
|
|
8
|
+
src/MoleditPy.egg-info/requires.txt
|
|
9
|
+
src/MoleditPy.egg-info/top_level.txt
|
|
10
|
+
src/moleditpy/__init__.py
|
|
11
|
+
src/moleditpy/__main__.py
|
|
12
|
+
src/moleditpy/main.py
|
|
13
|
+
src/moleditpy.egg-info/PKG-INFO
|
|
14
|
+
src/moleditpy.egg-info/SOURCES.txt
|
|
15
|
+
src/moleditpy.egg-info/dependency_links.txt
|
|
16
|
+
src/moleditpy.egg-info/entry_points.txt
|
|
17
|
+
src/moleditpy.egg-info/requires.txt
|
|
18
|
+
src/moleditpy.egg-info/top_level.txt
|
|
19
|
+
src/moleditpy/assets/file_icon.ico
|
|
20
|
+
src/moleditpy/assets/icon.icns
|
|
21
|
+
src/moleditpy/assets/icon.ico
|
|
22
|
+
src/moleditpy/assets/icon.png
|
|
23
|
+
src/moleditpy/modules/__init__.py
|
|
24
|
+
src/moleditpy/modules/about_dialog.py
|
|
25
|
+
src/moleditpy/modules/align_plane_dialog.py
|
|
26
|
+
src/moleditpy/modules/alignment_dialog.py
|
|
27
|
+
src/moleditpy/modules/analysis_window.py
|
|
28
|
+
src/moleditpy/modules/angle_dialog.py
|
|
29
|
+
src/moleditpy/modules/atom_item.py
|
|
30
|
+
src/moleditpy/modules/bond_item.py
|
|
31
|
+
src/moleditpy/modules/bond_length_dialog.py
|
|
32
|
+
src/moleditpy/modules/calculation_worker.py
|
|
33
|
+
src/moleditpy/modules/color_settings_dialog.py
|
|
34
|
+
src/moleditpy/modules/constants.py
|
|
35
|
+
src/moleditpy/modules/constrained_optimization_dialog.py
|
|
36
|
+
src/moleditpy/modules/custom_interactor_style.py
|
|
37
|
+
src/moleditpy/modules/custom_qt_interactor.py
|
|
38
|
+
src/moleditpy/modules/dialog_3d_picking_mixin.py
|
|
39
|
+
src/moleditpy/modules/dihedral_dialog.py
|
|
40
|
+
src/moleditpy/modules/main_window.py
|
|
41
|
+
src/moleditpy/modules/main_window_app_state.py
|
|
42
|
+
src/moleditpy/modules/main_window_compute.py
|
|
43
|
+
src/moleditpy/modules/main_window_dialog_manager.py
|
|
44
|
+
src/moleditpy/modules/main_window_edit_3d.py
|
|
45
|
+
src/moleditpy/modules/main_window_edit_actions.py
|
|
46
|
+
src/moleditpy/modules/main_window_export.py
|
|
47
|
+
src/moleditpy/modules/main_window_main_init.py
|
|
48
|
+
src/moleditpy/modules/main_window_molecular_parsers.py
|
|
49
|
+
src/moleditpy/modules/main_window_project_io.py
|
|
50
|
+
src/moleditpy/modules/main_window_string_importers.py
|
|
51
|
+
src/moleditpy/modules/main_window_ui_manager.py
|
|
52
|
+
src/moleditpy/modules/main_window_view_3d.py
|
|
53
|
+
src/moleditpy/modules/main_window_view_loaders.py
|
|
54
|
+
src/moleditpy/modules/mirror_dialog.py
|
|
55
|
+
src/moleditpy/modules/mol_geometry.py
|
|
56
|
+
src/moleditpy/modules/molecular_data.py
|
|
57
|
+
src/moleditpy/modules/molecular_scene_handler.py
|
|
58
|
+
src/moleditpy/modules/molecule_scene.py
|
|
59
|
+
src/moleditpy/modules/move_group_dialog.py
|
|
60
|
+
src/moleditpy/modules/periodic_table_dialog.py
|
|
61
|
+
src/moleditpy/modules/planarize_dialog.py
|
|
62
|
+
src/moleditpy/modules/plugin_interface.py
|
|
63
|
+
src/moleditpy/modules/plugin_manager.py
|
|
64
|
+
src/moleditpy/modules/plugin_manager_window.py
|
|
65
|
+
src/moleditpy/modules/settings_dialog.py
|
|
66
|
+
src/moleditpy/modules/sip_isdeleted_safe.py
|
|
67
|
+
src/moleditpy/modules/system_utils.py
|
|
68
|
+
src/moleditpy/modules/template_preview_item.py
|
|
69
|
+
src/moleditpy/modules/template_preview_view.py
|
|
70
|
+
src/moleditpy/modules/translation_dialog.py
|
|
71
|
+
src/moleditpy/modules/user_template_dialog.py
|
|
72
|
+
src/moleditpy/modules/zoomable_view.py
|
|
@@ -14,41 +14,23 @@ import ctypes
|
|
|
14
14
|
import sys
|
|
15
15
|
import argparse
|
|
16
16
|
import logging
|
|
17
|
-
import os
|
|
18
17
|
|
|
19
18
|
from PyQt6.QtWidgets import QApplication
|
|
20
19
|
|
|
21
20
|
try:
|
|
22
|
-
from .
|
|
21
|
+
from .modules.main_window import MainWindow
|
|
23
22
|
except ImportError:
|
|
24
|
-
|
|
25
|
-
src_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
|
26
|
-
if src_dir not in sys.path:
|
|
27
|
-
sys.path.insert(0, src_dir)
|
|
28
|
-
from moleditpy.ui.main_window import MainWindow
|
|
23
|
+
from modules.main_window import MainWindow
|
|
29
24
|
|
|
30
25
|
|
|
31
26
|
def setup_logging():
|
|
27
|
+
"""Configure global logging to standard output."""
|
|
32
28
|
logging.basicConfig(
|
|
33
29
|
level=logging.INFO,
|
|
34
|
-
format="%(asctime)s [%(levelname)s] %(name)s
|
|
30
|
+
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
|
|
35
31
|
stream=sys.stdout,
|
|
36
|
-
force=True,
|
|
37
32
|
)
|
|
38
33
|
|
|
39
|
-
def handle_exception(exc_type, exc_value, exc_traceback):
|
|
40
|
-
"""Log unhandled exceptions using the configured logging system."""
|
|
41
|
-
if issubclass(exc_type, KeyboardInterrupt):
|
|
42
|
-
# Allow keyboard interrupt to exit normally
|
|
43
|
-
sys.__excepthook__(exc_type, exc_value, exc_traceback)
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
logging.error(
|
|
47
|
-
"Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback)
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
sys.excepthook = handle_exception
|
|
51
|
-
|
|
52
34
|
|
|
53
35
|
def main():
|
|
54
36
|
# Setup logging as early as possible
|
|
@@ -1,35 +1,41 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
MoleditPy — A Python-based molecular editing software
|
|
6
|
-
|
|
7
|
-
Author: Hiromichi Yokoyama
|
|
8
|
-
License: GPL-3.0 license
|
|
9
|
-
Repo: https://github.com/HiroYokoyama/python_molecular_editor
|
|
10
|
-
DOI: 10.5281/zenodo.17268532
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
try:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
except
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
MoleditPy — A Python-based molecular editing software
|
|
6
|
+
|
|
7
|
+
Author: Hiromichi Yokoyama
|
|
8
|
+
License: GPL-3.0 license
|
|
9
|
+
Repo: https://github.com/HiroYokoyama/python_molecular_editor
|
|
10
|
+
DOI: 10.5281/zenodo.17268532
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
try:
|
|
14
|
+
import importlib.util
|
|
15
|
+
|
|
16
|
+
OBABEL_AVAILABLE = importlib.util.find_spec("openbabel") is not None
|
|
17
|
+
except ImportError:
|
|
18
|
+
OBABEL_AVAILABLE = False
|
|
19
|
+
|
|
20
|
+
try:
|
|
21
|
+
from PyQt6 import sip as _sip # type: ignore
|
|
22
|
+
|
|
23
|
+
_sip_isdeleted = getattr(_sip, "isdeleted", None)
|
|
24
|
+
except ImportError:
|
|
25
|
+
_sip = None
|
|
26
|
+
_sip_isdeleted = None
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def sip_isdeleted_safe(obj) -> bool:
|
|
30
|
+
"""Return True if sip reports the given wrapper object as deleted.
|
|
31
|
+
|
|
32
|
+
This function is conservative: if SIP isn't available or any error
|
|
33
|
+
occurs while checking, it returns False (i.e. not deleted) so that the
|
|
34
|
+
caller can continue other lightweight guards (like checking scene()).
|
|
35
|
+
"""
|
|
36
|
+
try:
|
|
37
|
+
if _sip_isdeleted is None:
|
|
38
|
+
return False
|
|
39
|
+
return bool(_sip_isdeleted(obj))
|
|
40
|
+
except (AttributeError, RuntimeError, TypeError):
|
|
41
|
+
return False
|
{moleditpy-3.0.0/src/moleditpy/ui → moleditpy-3.0.0a2/src/moleditpy/modules}/about_dialog.py
RENAMED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import logging
|
|
1
2
|
#!/usr/bin/env python3
|
|
2
3
|
# -*- coding: utf-8 -*-
|
|
3
4
|
|
|
@@ -10,8 +11,6 @@ Repo: https://github.com/HiroYokoyama/python_molecular_editor
|
|
|
10
11
|
DOI: 10.5281/zenodo.17268532
|
|
11
12
|
"""
|
|
12
13
|
|
|
13
|
-
import logging
|
|
14
|
-
|
|
15
14
|
import os
|
|
16
15
|
|
|
17
16
|
from PyQt6.QtCore import Qt
|
|
@@ -19,9 +18,9 @@ from PyQt6.QtGui import QCursor, QPainter, QPen, QPixmap
|
|
|
19
18
|
from PyQt6.QtWidgets import QDialog, QHBoxLayout, QLabel, QPushButton, QVBoxLayout
|
|
20
19
|
|
|
21
20
|
try:
|
|
22
|
-
from
|
|
21
|
+
from .constants import VERSION
|
|
23
22
|
except ImportError:
|
|
24
|
-
from
|
|
23
|
+
from modules.constants import VERSION
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
class AboutDialog(QDialog):
|
|
@@ -92,10 +91,10 @@ class AboutDialog(QDialog):
|
|
|
92
91
|
def image_clicked(self, event):
|
|
93
92
|
"""Easter egg: Clear all and load bipyrimidine from SMILES"""
|
|
94
93
|
# Clear the current scene
|
|
95
|
-
self.main_window.
|
|
94
|
+
self.main_window.clear_all()
|
|
96
95
|
|
|
97
96
|
bipyrimidine_smiles = "C1=CN=C(N=C1)C2=NC=CC=N2"
|
|
98
|
-
self.main_window.
|
|
97
|
+
self.main_window.load_from_smiles(bipyrimidine_smiles)
|
|
99
98
|
|
|
100
99
|
# Close the dialog
|
|
101
100
|
self.accept()
|