moleditpy 5.1.2__tar.gz → 5.1.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.
- {moleditpy-5.1.2 → moleditpy-5.1.3}/PKG-INFO +1 -1
- {moleditpy-5.1.2 → moleditpy-5.1.3}/pyproject.toml +1 -1
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/MoleditPy.egg-info/PKG-INFO +1 -1
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/ui_manager.py +25 -7
- {moleditpy-5.1.2 → moleditpy-5.1.3}/COPYING +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/DISTRIBUTION.md +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/LICENSE +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/LICENSING.md +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/README.md +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/THIRD_PARTY_NOTICES.md +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/setup.cfg +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/MoleditPy.egg-info/SOURCES.txt +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/MoleditPy.egg-info/dependency_links.txt +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/MoleditPy.egg-info/entry_points.txt +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/MoleditPy.egg-info/requires.txt +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/MoleditPy.egg-info/top_level.txt +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/__init__.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/__main__.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/assets/file_icon.ico +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/assets/icon.icns +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/assets/icon.ico +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/assets/icon.png +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/core/__init__.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/core/formal_charge.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/core/mol_geometry.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/core/molecular_data.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/core/project_validation.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/core/stereo_check.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/main.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/plugins/__init__.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/plugins/plugin_interface.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/plugins/plugin_manager.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/plugins/plugin_manager_window.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/__init__.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/about_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/align_plane_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/alignment_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/analysis_window.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/angle_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/app_state.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/atom_item.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/atom_picking.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/base_picking_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/bond_item.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/bond_length_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/calculation_worker.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/chain_mixin.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/chirality_warning_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/color_settings_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/compute_logic.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/constrained_optimization_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/custom_interactor_style.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/custom_qt_interactor.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/dialog_3d_picking_mixin.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/dialog_logic.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/dihedral_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/edit_3d_logic.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/edit_actions_logic.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/export_logic.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/geometry_base_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/io_logic.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/main_window.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/main_window_init.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/menu_utils.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/mirror_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/molecular_scene_handler.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/molecule_scene.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/move_dialog_mixin.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/move_group_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/move_selected_atoms_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/periodic_table_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/planarize_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/plugin_menu_manager.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/preview_molecule.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/sdf_record_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/settings_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/settings_tabs/__init__.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/settings_tabs/settings_2d_cleanup_tab.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/settings_tabs/settings_2d_tab.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/settings_tabs/settings_3d_tabs.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/settings_tabs/settings_labels_tab.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/settings_tabs/settings_other_tab.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/settings_tabs/settings_tab_base.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/string_importers.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/template_preview_item.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/template_preview_view.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/translation_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/user_template_dialog.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/view_3d_logic.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/zoomable_view.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/utils/__init__.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/utils/constants.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/utils/default_settings.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/utils/finite_float.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/utils/hit_radius.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/utils/label_style.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/utils/sdf_records.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/utils/sip_isdeleted_safe.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/utils/suppress_log.py +0 -0
- {moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/utils/system_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MoleditPy
|
|
3
|
-
Version: 5.1.
|
|
3
|
+
Version: 5.1.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-Expression: LGPL-3.0-or-later
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MoleditPy
|
|
3
|
-
Version: 5.1.
|
|
3
|
+
Version: 5.1.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-Expression: LGPL-3.0-or-later
|
|
@@ -13,7 +13,7 @@ DOI: 10.5281/zenodo.17268532
|
|
|
13
13
|
from __future__ import annotations
|
|
14
14
|
|
|
15
15
|
import logging
|
|
16
|
-
from typing import Any, Optional
|
|
16
|
+
from typing import Any, Optional, Union
|
|
17
17
|
|
|
18
18
|
import vtk
|
|
19
19
|
|
|
@@ -370,6 +370,20 @@ class UIManager(QObject):
|
|
|
370
370
|
except (AttributeError, RuntimeError):
|
|
371
371
|
logging.debug("Style watchdog check failed", exc_info=True)
|
|
372
372
|
|
|
373
|
+
@staticmethod
|
|
374
|
+
def _accept_as_copy(event: Union[QDragEnterEvent, QDropEvent]) -> None:
|
|
375
|
+
"""Accept a file drag as a copy, or refuse it if the source cannot copy.
|
|
376
|
+
|
|
377
|
+
Never acceptProposedAction(): Shift during a drag from Explorer proposes
|
|
378
|
+
a move, and accepting one tells Explorer the file now lives here, so it
|
|
379
|
+
removes the original. MoleditPy only ever reads a dropped file.
|
|
380
|
+
"""
|
|
381
|
+
if event.possibleActions() & Qt.DropAction.CopyAction:
|
|
382
|
+
event.setDropAction(Qt.DropAction.CopyAction)
|
|
383
|
+
event.accept()
|
|
384
|
+
else:
|
|
385
|
+
event.ignore()
|
|
386
|
+
|
|
373
387
|
def handle_drag_enter_event(self, event: QDragEnterEvent) -> None:
|
|
374
388
|
"""Internal handler for drag enter event (bypasses PyQt type checks in tests)."""
|
|
375
389
|
mime_data = event.mimeData()
|
|
@@ -384,13 +398,13 @@ class UIManager(QObject):
|
|
|
384
398
|
file_lower = url.toLocalFile().lower()
|
|
385
399
|
# 1. Built-in extensions
|
|
386
400
|
if file_lower.endswith((".pmeraw", ".pmeprj", ".mol", ".sdf", ".xyz")):
|
|
387
|
-
|
|
401
|
+
self._accept_as_copy(event)
|
|
388
402
|
return
|
|
389
403
|
|
|
390
404
|
# 2. Plugin drop handlers (accept if any handlers exist)
|
|
391
405
|
plugin_mgr = getattr(self.host, "plugin_manager", None)
|
|
392
406
|
if plugin_mgr and getattr(plugin_mgr, "drop_handlers", []):
|
|
393
|
-
|
|
407
|
+
self._accept_as_copy(event)
|
|
394
408
|
return
|
|
395
409
|
|
|
396
410
|
event.ignore()
|
|
@@ -406,13 +420,17 @@ class UIManager(QObject):
|
|
|
406
420
|
if not file_path:
|
|
407
421
|
event.ignore()
|
|
408
422
|
return
|
|
423
|
+
# Before anything opens: a source that can only move is refused outright.
|
|
424
|
+
if not event.possibleActions() & Qt.DropAction.CopyAction:
|
|
425
|
+
event.ignore()
|
|
426
|
+
return
|
|
409
427
|
|
|
410
428
|
# 1. Plugin Handlers
|
|
411
429
|
plugin_mgr = getattr(self.host, "plugin_manager", None)
|
|
412
430
|
for handler_def in getattr(plugin_mgr, "drop_handlers", []):
|
|
413
431
|
try:
|
|
414
432
|
if handler_def["callback"](file_path):
|
|
415
|
-
|
|
433
|
+
self._accept_as_copy(event)
|
|
416
434
|
return
|
|
417
435
|
except Exception: # plugins have full app access; catch everything to prevent app-wide crash
|
|
418
436
|
logging.warning("Error in plugin drop handler", exc_info=True)
|
|
@@ -422,7 +440,7 @@ class UIManager(QObject):
|
|
|
422
440
|
if file_lower.endswith((".pmeraw", ".pmeprj")):
|
|
423
441
|
self.host.io_manager.open_project_file(file_path=file_path)
|
|
424
442
|
QTimer.singleShot(100, self.host.view_3d_manager.fit_to_view)
|
|
425
|
-
|
|
443
|
+
self._accept_as_copy(event)
|
|
426
444
|
elif file_lower.endswith((".mol", ".sdf")):
|
|
427
445
|
# Robust check for drop target using childAt
|
|
428
446
|
drag_point = event.position().toPoint()
|
|
@@ -450,11 +468,11 @@ class UIManager(QObject):
|
|
|
450
468
|
self.host.io_manager.load_mol_file(file_path=file_path)
|
|
451
469
|
QTimer.singleShot(100, self.host.view_3d_manager.fit_to_view)
|
|
452
470
|
|
|
453
|
-
|
|
471
|
+
self._accept_as_copy(event)
|
|
454
472
|
elif file_lower.endswith(".xyz"):
|
|
455
473
|
self.host.io_manager.load_xyz_for_3d_viewing(file_path=file_path)
|
|
456
474
|
QTimer.singleShot(100, self.host.view_3d_manager.fit_to_view)
|
|
457
|
-
|
|
475
|
+
self._accept_as_copy(event)
|
|
458
476
|
else:
|
|
459
477
|
self.host.statusBar().showMessage(f"Unsupported file type: {file_path}")
|
|
460
478
|
event.ignore()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{moleditpy-5.1.2 → moleditpy-5.1.3}/src/moleditpy/ui/settings_tabs/settings_2d_cleanup_tab.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|