Skip to content

Commit e264388

Browse files
committed
clean-up very old winpython
1 parent 1cd4b39 commit e264388

File tree

5 files changed

+49
-11
lines changed

5 files changed

+49
-11
lines changed

make.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,16 +1921,30 @@ def _create_batch_scripts(self):
19211921

19221922
self.create_python_batch(
19231923
'register_python.bat',
1924-
'register_python',
1924+
r'"%WINPYDIR%\Lib\site-packages\winpython\register_python.py"',
19251925
workdir=r'"%WINPYDIR%\Scripts"',
19261926
)
1927+
1928+
self.create_python_batch(
1929+
'unregister_python.bat',
1930+
r'"%WINPYDIR%\Lib\site-packages\winpython\unregister_python.py"',
1931+
workdir=r'"%WINPYDIR%\Scripts"',
1932+
)
1933+
19271934
self.create_batch_script(
19281935
'register_python_for_all.bat',
19291936
r"""@echo off
19301937
call "%~dp0env.bat"
19311938
call "%~dp0register_python.bat" --all""",
19321939
)
1933-
1940+
1941+
self.create_batch_script(
1942+
'unregister_python_for_all.bat',
1943+
r"""@echo off
1944+
call "%~dp0env.bat"
1945+
call "%~dp0unregister_python.bat" --all""",
1946+
)
1947+
19341948
self.create_batch_script(
19351949
'wpcp.bat',
19361950
r"""@echo off

scripts/register_python.bat

Lines changed: 0 additions & 2 deletions
This file was deleted.

setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ def get_subpackages(name):
8383
)
8484
},
8585
# requires=["PyQt4 (>=4.5)"],
86-
scripts=[
87-
osp.join('scripts', fname)
88-
for fname in (
89-
'register_python',
90-
'register_python.bat',
91-
)
92-
],
86+
#scripts=[
87+
# osp.join('scripts', fname)
88+
# for fname in (
89+
# 'register_python',
90+
# 'register_python.bat',
91+
# )
92+
#],
9393
# use setuptools functionalities
9494
entry_points={
9595
'console_scripts': [

winpython/unregister_python.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python
2+
import sys
3+
from winpython import associate, utils
4+
from argparse import ArgumentParser
5+
6+
parser = ArgumentParser(description="unRegister Python file extensions, icons "\
7+
"and Windows explorer context menu to a target "\
8+
"Python distribution.")
9+
try:
10+
str_type = unicode
11+
except NameError:
12+
str_type = str
13+
parser.add_argument('--target', metavar='path', type=str,
14+
default=sys.prefix,
15+
help='path to the target Python distribution')
16+
parser.add_argument('--all', dest='all', action='store_const',
17+
const=True, default=False,
18+
help='unregister to all users, requiring administrative '\
19+
'privileges (default: register to current user only)')
20+
args = parser.parse_args()
21+
22+
print(args.target)
23+
if utils.is_python_distribution(args.target):
24+
associate.unregister(args.target, current=not args.all)
25+
else:
26+
raise WindowsError("Invalid Python distribution %s" % args.target)

0 commit comments

Comments
 (0)