MoleditPy 2.2.3__py3-none-any.whl → 2.2.4__py3-none-any.whl

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.
@@ -16,7 +16,7 @@ from PyQt6.QtGui import QFont, QColor
16
16
  from rdkit import Chem
17
17
 
18
18
  #Version
19
- VERSION = '2.2.3'
19
+ VERSION = '2.2.4'
20
20
 
21
21
  ATOM_RADIUS = 18
22
22
  BOND_OFFSET = 3.5
@@ -1934,29 +1934,52 @@ class MainWindowMainInit(object):
1934
1934
  a.setData(PLUGIN_ACTION_TAG)
1935
1935
  menu.addAction(a)
1936
1936
 
1937
+ # 5. Integrate File Openers into Import Menu
1937
1938
  # 5. Integrate File Openers into Import Menu
1938
1939
  if hasattr(self, 'import_menu') and self.plugin_manager.file_openers:
1939
1940
  # Add separator
1940
1941
  sep = self.import_menu.addSeparator()
1941
1942
  sep.setData(PLUGIN_ACTION_TAG)
1942
1943
 
1944
+ # Group by Plugin Name
1945
+ plugin_map = {}
1943
1946
  for ext, info in self.plugin_manager.file_openers.items():
1944
- label = f"Import {ext} ({info.get('plugin', 'Plugin')})..."
1947
+ p_name = info.get('plugin', 'Plugin')
1948
+ if p_name not in plugin_map:
1949
+ plugin_map[p_name] = {}
1950
+ plugin_map[p_name][ext] = info['callback']
1951
+
1952
+ for p_name, ext_map in plugin_map.items():
1953
+ # Create combined label: "Import .ext1/.ext2 (PluginName)..."
1954
+ extensions = sorted(ext_map.keys())
1955
+ ext_str = "/".join(extensions)
1956
+ label = f"Import {ext_str} ({p_name})..."
1957
+
1958
+ # Create combined filter: "PluginName Files (*.ext1 *.ext2)"
1959
+ filter_exts = " ".join([f"*{e}" for e in extensions])
1960
+ filter_str = f"{p_name} Files ({filter_exts});;All Files (*)"
1945
1961
 
1946
- def make_cb(callback):
1962
+ # Factory for callback to fix closure capture
1963
+ def make_unified_cb(extensions_map, dialog_filter, plugin_nm):
1947
1964
  def _cb():
1948
1965
  fpath, _ = QFileDialog.getOpenFileName(
1949
- self, f"Import {ext}", "",
1950
- f"{info.get('plugin', 'Plugin')} File (*{ext});;All Files (*)"
1966
+ self, f"Import {plugin_nm} Files", "",
1967
+ dialog_filter
1951
1968
  )
1952
1969
  if fpath:
1953
- callback(fpath)
1954
- self.current_file_path = fpath
1955
- self.update_window_title()
1970
+ _, extension = os.path.splitext(fpath)
1971
+ extension = extension.lower()
1972
+ # Dispatch to specific callback
1973
+ if extension in extensions_map:
1974
+ extensions_map[extension](fpath)
1975
+ self.current_file_path = fpath
1976
+ self.update_window_title()
1977
+ else:
1978
+ self.statusBar().showMessage(f"No handler for extension {extension}")
1956
1979
  return _cb
1957
1980
 
1958
1981
  a = QAction(label, self)
1959
- a.triggered.connect(make_cb(info['callback']))
1982
+ a.triggered.connect(make_unified_cb(ext_map, filter_str, p_name))
1960
1983
  a.setData(PLUGIN_ACTION_TAG)
1961
1984
  self.import_menu.addAction(a)
1962
1985
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MoleditPy
3
- Version: 2.2.3
3
+ Version: 2.2.4
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
@@ -12,7 +12,7 @@ moleditpy/modules/bond_item.py,sha256=eVkEeKvM4igYI67DYxpey3FllqDyt_iWDo4VPYMhaP
12
12
  moleditpy/modules/bond_length_dialog.py,sha256=k5x_DhK9Q8CSwouKhEo_kLRRdaYHDaK84KDNmuDNLvY,14868
13
13
  moleditpy/modules/calculation_worker.py,sha256=KiGQY7i-QCQofEoE0r65KoQgpEGFcbhmxWv6egfkUdc,42324
14
14
  moleditpy/modules/color_settings_dialog.py,sha256=Ow44BhCOLo0AFb6klO001k6B4drOgKX9DeNBQhZLp5o,15474
15
- moleditpy/modules/constants.py,sha256=6ZL8sYwh2Ll3nnexffllLRdcfjDIeYvgNrGPjmnvv0o,4702
15
+ moleditpy/modules/constants.py,sha256=FZjG-RLZs_Xqn8D7MDAGKZAJY4G44Bh2Nm2qnDTFXm8,4702
16
16
  moleditpy/modules/constrained_optimization_dialog.py,sha256=IEdNVhFoNSEMeA5ABpUH9Q88-YzDXFloQM2gwnPwnHY,30150
17
17
  moleditpy/modules/custom_interactor_style.py,sha256=NjsXE2a43IDNEanZBlcG9eR4ZIERT1MsQC6lbfesapQ,38453
18
18
  moleditpy/modules/custom_qt_interactor.py,sha256=MFaTuDh-FPeFBS4303CqxsxmsOIOW4QXUz6USwI8PHQ,2451
@@ -25,7 +25,7 @@ moleditpy/modules/main_window_dialog_manager.py,sha256=9ZVy5-dlk8SjGU5R6NtbaVZuB
25
25
  moleditpy/modules/main_window_edit_3d.py,sha256=CUArB5wcsgq1C7LygAEC6URlbnn4RhRYDa5n-Y-etWI,19731
26
26
  moleditpy/modules/main_window_edit_actions.py,sha256=-SDLoMQ7S-3u3eBUb-w7BU7OAsFkhQ9ZBjF3Y2jGgZc,64708
27
27
  moleditpy/modules/main_window_export.py,sha256=dSVfylsybDDboDuXU9Inotf6YkrKJwgBTqGYSfq1lRE,38241
28
- moleditpy/modules/main_window_main_init.py,sha256=Yr7TbPgpqVIImZE0BznCLDxsLufQj-QXQGQd6x0kopk,89281
28
+ moleditpy/modules/main_window_main_init.py,sha256=ZxScNJI-OVx_ki5C37fY4Dmm9IIm5eJWVwd7jIKu8ms,90606
29
29
  moleditpy/modules/main_window_molecular_parsers.py,sha256=KR6vzuqc3nutOcorpYr0QOyX3MFBcxTwDhZX96VgJ9Q,48291
30
30
  moleditpy/modules/main_window_project_io.py,sha256=TWwtuKDuvgcvPZ9IGmW8r1EJJOrgxrIJRnxe_f4C1oM,17149
31
31
  moleditpy/modules/main_window_string_importers.py,sha256=v47wOd4RtjKYcF-aLP-mogGGdYTpTEo3dDyAu79_5MM,10782
@@ -50,9 +50,9 @@ moleditpy/modules/zoomable_view.py,sha256=hjwljui13QpvjvxJHY4Evot4jMQvxRBQUNH5HU
50
50
  moleditpy/modules/assets/icon.icns,sha256=wD5R6-Vw7K662tVKhu2E1ImN0oUuyAP4youesEQsn9c,139863
51
51
  moleditpy/modules/assets/icon.ico,sha256=RfgFcx7-dHY_2STdsOQCQziY5SNhDr3gPnjO6jzEDPI,147975
52
52
  moleditpy/modules/assets/icon.png,sha256=kCFN1WacYIdy0GN6SFEbNA00ef39pCczBnFdkkBI8Bs,147110
53
- moleditpy-2.2.3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
54
- moleditpy-2.2.3.dist-info/METADATA,sha256=kGSCcH5wBYrJ5hZW1Pvijb2kkCNfXGq1Pb5Mj2FxlPk,59275
55
- moleditpy-2.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
56
- moleditpy-2.2.3.dist-info/entry_points.txt,sha256=yH1h9JjALhok1foXT3-hYrC4ufoZt8b7oiBcsdnGNNM,54
57
- moleditpy-2.2.3.dist-info/top_level.txt,sha256=ARICrS4ihlPXqywlKl6o-oJa3Qz3gZRWu_VZsQ3_c44,10
58
- moleditpy-2.2.3.dist-info/RECORD,,
53
+ moleditpy-2.2.4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
54
+ moleditpy-2.2.4.dist-info/METADATA,sha256=4DwSe5WZS_c8tGB0qVe71o9m2Rc20x5Up7E26fQvNG8,59275
55
+ moleditpy-2.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
56
+ moleditpy-2.2.4.dist-info/entry_points.txt,sha256=yH1h9JjALhok1foXT3-hYrC4ufoZt8b7oiBcsdnGNNM,54
57
+ moleditpy-2.2.4.dist-info/top_level.txt,sha256=ARICrS4ihlPXqywlKl6o-oJa3Qz3gZRWu_VZsQ3_c44,10
58
+ moleditpy-2.2.4.dist-info/RECORD,,