-
Notifications
You must be signed in to change notification settings - Fork 481
Expand file tree
/
Copy pathinstall.py
More file actions
41 lines (34 loc) · 1.51 KB
/
install.py
File metadata and controls
41 lines (34 loc) · 1.51 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python
import argparse
from os.path import dirname, abspath, join
from notebook.nbextensions import install_nbextension
def install(user=False, symlink=False, overwrite=False, **kwargs):
"""Install the bqplot nbextension.
Parameters
----------
user: bool
Install for current user instead of system-wide.
symlink: bool
Symlink instead of copy (for development).
overwrite: bool
Overwrite previously-installed files for this extension
**kwargs: keyword arguments
Other keyword arguments passed to the install_nbextension command
"""
directory = join(dirname(abspath(__file__)), 'nbextension')
install_nbextension(directory, destination='bqplot',
symlink=symlink, user=user, overwrite=overwrite,
**kwargs)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Installs the bqplot widget")
parser.add_argument("-u", "--user",
help="Install as current user instead of system-wide",
action="store_true")
parser.add_argument("-s", "--symlink",
help="Symlink instead of copying files",
action="store_true")
parser.add_argument("-f", "--force",
help="Overwrite any previously-installed files for this extension",
action="store_true")
args = parser.parse_args()
install(user=args.user, symlink=args.symlink, overwrite=args.force)