Skip to content

Commit 3b61bc5

Browse files
committed
WinPython registration: Python Scripts are now Droppable in Windows explorer.
Thanks to charlie for pointing out this missing feature in the registration process. See the following thread: https://groups.google.com/forum/#!topic/winpython/pBKrV-qcTV4
1 parent 445e232 commit 3b61bc5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

winpython/associate.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
KEY_C0 = KEY_C % r"Python.%sFile\shell"
2727
KEY_C1 = KEY_C % r"Python.%sFile\shell\%s"
2828
KEY_C2 = KEY_C1 + r"\command"
29+
KEY_DROP0 = KEY_C % r"Python.%sFile\shellex"
30+
KEY_DROP1 = KEY_C % r"Python.%sFile\shellex\DropHandler"
2931
KEY_I = KEY_C % r"Python.%sFile\DefaultIcon"
3032
KEY_D = KEY_C % r"Python.%sFile"
3133
EWI = "Edit with IDLE"
@@ -92,6 +94,12 @@ def register(target, current=True):
9294
winreg.SetValueEx(winreg.CreateKey(root, KEY_C2 % ("NoCon", EWS)),
9395
"", 0, winreg.REG_SZ,
9496
'"%s" "%s\Scripts\spyder" "%%1"' % (pythonw, target))
97+
98+
# Drop support
99+
handler = "{60254CA5-953B-11CF-8C96-00AA00B8708C}"
100+
for ftype in ("", "NoCon", "Compiled"):
101+
winreg.SetValueEx(winreg.CreateKey(root, KEY_DROP1 % ftype),
102+
"", 0, winreg.REG_SZ, handler)
95103

96104
# Icons
97105
dlls = osp.join(target, 'DLLs')
@@ -150,6 +158,9 @@ def unregister(target, current=True):
150158
short_version = utils.get_python_infos(target)[0]
151159
key_core = (KEY_S1 % short_version) + r'\%s'
152160
for key in (
161+
# Drop support
162+
KEY_DROP1 % "", KEY_DROP1 % "NoCon", KEY_DROP1 % "Compiled",
163+
KEY_DROP0 % "", KEY_DROP0 % "NoCon", KEY_DROP0 % "Compiled",
153164
# Icons
154165
KEY_I % "NoCon", KEY_I % "Compiled", KEY_I % "",
155166
# Edit with IDLE

0 commit comments

Comments
 (0)