MoleditPy 2.3.2__tar.gz → 2.3.3__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.
Files changed (64) hide show
  1. {moleditpy-2.3.2 → moleditpy-2.3.3}/PKG-INFO +1 -1
  2. {moleditpy-2.3.2 → moleditpy-2.3.3}/pyproject.toml +1 -1
  3. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/MoleditPy.egg-info/PKG-INFO +1 -1
  4. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/constants.py +1 -1
  5. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_edit_actions.py +4 -0
  6. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_main_init.py +5 -0
  7. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/plugin_interface.py +10 -0
  8. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/plugin_manager.py +17 -0
  9. {moleditpy-2.3.2 → moleditpy-2.3.3}/LICENSE +0 -0
  10. {moleditpy-2.3.2 → moleditpy-2.3.3}/README.md +0 -0
  11. {moleditpy-2.3.2 → moleditpy-2.3.3}/setup.cfg +0 -0
  12. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/MoleditPy.egg-info/SOURCES.txt +0 -0
  13. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/MoleditPy.egg-info/dependency_links.txt +0 -0
  14. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/MoleditPy.egg-info/entry_points.txt +0 -0
  15. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/MoleditPy.egg-info/requires.txt +0 -0
  16. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/MoleditPy.egg-info/top_level.txt +0 -0
  17. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/__init__.py +0 -0
  18. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/__main__.py +0 -0
  19. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/main.py +0 -0
  20. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/__init__.py +0 -0
  21. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/about_dialog.py +0 -0
  22. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/align_plane_dialog.py +0 -0
  23. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/alignment_dialog.py +0 -0
  24. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/analysis_window.py +0 -0
  25. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/angle_dialog.py +0 -0
  26. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/assets/file_icon.ico +0 -0
  27. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/assets/icon.icns +0 -0
  28. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/assets/icon.ico +0 -0
  29. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/assets/icon.png +0 -0
  30. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/atom_item.py +0 -0
  31. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/bond_item.py +0 -0
  32. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/bond_length_dialog.py +0 -0
  33. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/calculation_worker.py +0 -0
  34. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/color_settings_dialog.py +0 -0
  35. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/constrained_optimization_dialog.py +0 -0
  36. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/custom_interactor_style.py +0 -0
  37. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/custom_qt_interactor.py +0 -0
  38. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/dialog3_d_picking_mixin.py +0 -0
  39. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/dihedral_dialog.py +0 -0
  40. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window.py +0 -0
  41. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_app_state.py +0 -0
  42. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_compute.py +0 -0
  43. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_dialog_manager.py +0 -0
  44. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_edit_3d.py +0 -0
  45. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_export.py +0 -0
  46. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_molecular_parsers.py +0 -0
  47. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_project_io.py +0 -0
  48. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_string_importers.py +0 -0
  49. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_ui_manager.py +0 -0
  50. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_view_3d.py +0 -0
  51. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/main_window_view_loaders.py +0 -0
  52. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/mirror_dialog.py +0 -0
  53. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/molecular_data.py +0 -0
  54. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/molecule_scene.py +0 -0
  55. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/move_group_dialog.py +0 -0
  56. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/periodic_table_dialog.py +0 -0
  57. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/planarize_dialog.py +0 -0
  58. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/plugin_manager_window.py +0 -0
  59. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/settings_dialog.py +0 -0
  60. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/template_preview_item.py +0 -0
  61. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/template_preview_view.py +0 -0
  62. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/translation_dialog.py +0 -0
  63. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/user_template_dialog.py +0 -0
  64. {moleditpy-2.3.2 → moleditpy-2.3.3}/src/moleditpy/modules/zoomable_view.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MoleditPy
3
- Version: 2.3.2
3
+ Version: 2.3.3
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
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "MoleditPy"
7
7
 
8
- version = "2.3.2"
8
+ version = "2.3.3"
9
9
 
10
10
  license = {file = "LICENSE"}
11
11
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MoleditPy
3
- Version: 2.3.2
3
+ Version: 2.3.3
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
@@ -16,7 +16,7 @@ from PyQt6.QtGui import QFont, QColor
16
16
  from rdkit import Chem
17
17
 
18
18
  #Version
19
- VERSION = '2.3.2'
19
+ VERSION = '2.3.3'
20
20
 
21
21
  ATOM_RADIUS = 18
22
22
  BOND_OFFSET = 3.5
@@ -641,6 +641,10 @@ class MainWindowEditActions(object):
641
641
  # アプリケーションのイベントループを強制的に処理し、画面の再描画を確実に行う
642
642
  QApplication.processEvents()
643
643
 
644
+ # Call plugin document reset handlers
645
+ if hasattr(self, 'plugin_manager') and self.plugin_manager:
646
+ self.plugin_manager.invoke_document_reset_handlers()
647
+
644
648
  self.statusBar().showMessage("Cleared all data.")
645
649
 
646
650
 
@@ -1851,6 +1851,11 @@ class MainWindowMainInit(object):
1851
1851
  action_text = text if text else parts[-1]
1852
1852
  action = QAction(action_text, self)
1853
1853
  action.triggered.connect(callback)
1854
+
1855
+ # Apply shortcut if provided
1856
+ if action_def.get('shortcut'):
1857
+ action.setShortcut(QKeySequence(action_def['shortcut']))
1858
+
1854
1859
  action.setData(PLUGIN_ACTION_TAG) # TAG THE ACTION
1855
1860
  current_menu.addAction(action)
1856
1861
 
@@ -168,6 +168,16 @@ class PluginContext:
168
168
  """
169
169
  self._manager.register_3d_style(self._plugin_name, style_name, callback)
170
170
 
171
+ def register_document_reset_handler(self, callback: Callable[[], None]):
172
+ """
173
+ Register a callback to be called when a new document is created (File→New).
174
+
175
+ Args:
176
+ callback: Function with no arguments that resets plugin state.
177
+ """
178
+ self._manager.register_document_reset_handler(self._plugin_name, callback)
179
+
180
+
171
181
 
172
182
 
173
183
 
@@ -51,6 +51,7 @@ class PluginManager:
51
51
  self.save_handlers = {}
52
52
  self.load_handlers = {}
53
53
  self.custom_3d_styles = {} # style_name -> {'plugin': name, 'callback': func}
54
+ self.document_reset_handlers = [] # List of callbacks to call on new document
54
55
 
55
56
  def get_main_window(self):
56
57
  return self.main_window
@@ -182,6 +183,7 @@ class PluginManager:
182
183
  self.save_handlers = {}
183
184
  self.load_handlers = {}
184
185
  self.custom_3d_styles = {}
186
+ self.document_reset_handlers = []
185
187
 
186
188
  if not os.path.exists(self.plugin_dir):
187
189
  return []
@@ -378,6 +380,21 @@ class PluginManager:
378
380
  self.custom_3d_styles[style_name] = {
379
381
  'plugin': plugin_name, 'callback': callback
380
382
  }
383
+
384
+ def register_document_reset_handler(self, plugin_name, callback):
385
+ """Register callback to be invoked when a new document is created."""
386
+ self.document_reset_handlers.append({
387
+ 'plugin': plugin_name,
388
+ 'callback': callback
389
+ })
390
+
391
+ def invoke_document_reset_handlers(self):
392
+ """Call all registered document reset handlers."""
393
+ for handler in self.document_reset_handlers:
394
+ try:
395
+ handler['callback']()
396
+ except Exception as e:
397
+ print(f"Error in document reset handler for {handler['plugin']}: {e}")
381
398
 
382
399
  def get_plugin_info_safe(self, file_path):
383
400
  """Extracts plugin metadata using AST parsing (safe, no execution)."""
File without changes
File without changes
File without changes