/
bundle.py
73 lines (60 loc) · 2.09 KB
/
bundle.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from bokeh.command.subcommand import Subcommand
from ..compiler import (
bundle_icons, bundle_models, bundle_resource_urls, bundle_resources,
bundle_templates, bundle_themes,
)
class Bundle(Subcommand):
''' Subcommand to generate a new encryption key.
'''
#: name for this subcommand
name = "bundle"
help = "Bundle resources"
args = (
('--all', dict(
action = 'store_true',
help = "Whether to bundle everything"
)),
('--resource-urls', dict(
action = 'store_true',
help = "Whether to bundle the global resources"
)),
('--templates', dict(
action = 'store_true',
help = "Whether to bundle the template resources"
)),
('--themes', dict(
action = 'store_true',
help = "Whether to bundle the theme resources"
)),
('--models', dict(
action = 'store_true',
help = "Whether to bundle the model resources"
)),
('--icons', dict(
action = 'store_true',
help = "Whether to bundle icons."
)),
('--verbose', dict(
action = 'store_true',
help = "Whether to print progress"
)),
('--only-local', dict(
action = 'store_true',
help = "Whether to bundle only local resources"
)),
)
def invoke(self, args):
verbose = args.verbose
if args.all:
bundle_resources(verbose=verbose, external=not args.only_local)
return
if args.resource_urls:
bundle_resource_urls(verbose=verbose, external=not args.only_local)
if args.models:
bundle_models(verbose=verbose, external=not args.only_local)
if args.templates:
bundle_templates(verbose=verbose, external=not args.only_local)
if args.themes:
bundle_themes(verbose=verbose, external=not args.only_local)
if args.icons:
bundle_icons(verbose=verbose, external=not args.only_local)