FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
winpython/scripts/register_python at master · codecopy/winpython · GitHub
codecopy
/
winpython
Public
forked from
winpython/winpython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
winpython
/
scripts
/
register_python
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (24 loc) · 1.01 KB
Breadcrumbs
winpython
/
scripts
/
register_python
Copy path
File metadata and controls
26 lines (24 loc) · 1.01 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
import
sys
from
winpython
import
associate
,
utils
from
argparse
import
ArgumentParser
parser
=
ArgumentParser
(
description
=
"Register Python file extensions, icons "
\
"and Windows explorer context menu to a target "
\
"Python distribution."
)
try
:
str_type
=
unicode
except
NameError
:
str_type
=
str
parser
.
add_argument
(
'--target'
,
metavar
=
'path'
,
type
=
str
,
default
=
sys
.
prefix
,
help
=
'path to the target Python distribution'
)
parser
.
add_argument
(
'--all'
,
dest
=
'all'
,
action
=
'store_const'
,
const
=
True
,
default
=
False
,
help
=
'register to all users, requiring administrative '
\
'privileges (default: register to current user only)'
)
args
=
parser
.
parse_args
()
print
(
args
.
target
)
if
utils
.
is_python_distribution
(
args
.
target
):
associate
.
register
(
args
.
target
,
current
=
not
args
.
all
)
else
:
raise
WindowsError
(
"Invalid Python distribution %s"
%
args
.
target
)
Back
|
FazBrowse Home
|
New Git URL