-
Notifications
You must be signed in to change notification settings - Fork 20
Adds drop handler and MSI registration. #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Only a draft right now, because it doesn't load properly when installed via a test MSI (works fine if I hack in the registration). I need to do more testing, but can't do it right now. Isn't going to work at all for the MSIX, so this will also need a troublshooting entry over on the docs. |
|
It works fine on a clean machine, so let's take it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds drag-and-drop support for Python files by implementing a new COM drop handler (DragDropSupport class) and registering it in both MSI and MSIX/AppX packages. When files are dragged onto a Python script, the drop handler will execute the script with the dropped files as arguments.
Key Changes:
- Implemented
DragDropSupportCOM class withIDropTargetandIPersistFileinterfaces - Added drop handler registration in MSI for
.pyand.pywfile types - Added context menu registration for
.pywfiles in AppX manifest - Added test coverage for argument parsing and drop description functionality
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pyshellext/shellext.cpp | Implements DragDropSupport COM class for handling drag-and-drop operations, including argument parsing from dropped files and execution logic |
| src/pyshellext/shellext.h | Adds function declarations for new drop-related helper functions |
| src/pyshellext/shellext_test.cpp | Adds Python test wrapper functions for the new drop argument parsing and description functions |
| tests/test_shellext.py | Adds unit tests for argument parsing (wide and ASCII) and drop description extraction |
| src/pymanager/msi.wxs | Registers the DragDropSupport COM class and associates it as a drop handler for Python.File and Python.NoConFile ProgIds |
| src/pymanager/appxmanifest.xml | Adds context menu verb registration for .pyw files using the EditInIdle command |
| _msbuild.py | Adds pathcch.lib dependency required for path manipulation in the drop handler |
| _msbuild_test.py | Adds pathcch.lib dependency and exports new test functions for the drop handler |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #217