forked from damianavila/RISE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
38 lines (28 loc) · 1.28 KB
/
setup.py
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
import os
from notebook.nbextensions import install_nbextension
from notebook.services.config import ConfigManager
livereveal_dir = os.path.join(os.path.dirname(__file__), 'livereveal')
def install(use_symlink=False, enable=True):
# Install the livereveal code.
install_nbextension(livereveal_dir, symlink=use_symlink,
overwrite=use_symlink, user=True)
if enable:
cm = ConfigManager()
cm.update('notebook', {"load_extensions": {"livereveal/main": True}})
def main():
import argparse
import sys
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(title='subcommands',
description='valid subcommands',
help='additional help')
install_parser = subparsers.add_parser('install')
install_parser.add_argument('--develop', action='store_true',
help="Install livereveal as a symlink to the source.")
install_parser.add_argument('--no-enable', action='store_true',
help="Install but don't enable the extension.")
args = parser.parse_args(sys.argv[1:])
install(use_symlink=args.develop,
enable=(not args.no_enable))
if __name__ == '__main__':
main()