Mercurial > piecrust2
comparison piecrust/commands/builtin/baking.py @ 199:aaf08277b96d
bake: Remove `--portable` option until it's (maybe) implemented.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 13 Jan 2015 20:41:44 -0800 |
parents | 5d8351cb32d8 |
children | 0c9de41689bb |
comparison
equal
deleted
inserted
replaced
198:1d44d8bd93e2 | 199:aaf08277b96d |
---|---|
30 parser.add_argument( | 30 parser.add_argument( |
31 '-f', '--force', | 31 '-f', '--force', |
32 help="Force re-baking the entire website.", | 32 help="Force re-baking the entire website.", |
33 action='store_true') | 33 action='store_true') |
34 parser.add_argument( | 34 parser.add_argument( |
35 '--portable', | |
36 help="Uses relative paths for all URLs.", | |
37 action='store_true') | |
38 parser.add_argument( | |
39 '--no-assets', | 35 '--no-assets', |
40 help="Don't process assets (only pages).", | 36 help="Don't process assets (only pages).", |
41 action='store_true') | 37 action='store_true') |
42 | 38 |
43 def run(self, ctx): | 39 def run(self, ctx): |
44 if ctx.args.portable: | |
45 # Disable pretty URLs because there's likely not going to be | |
46 # a web server to handle serving default documents. | |
47 ctx.app.config.set('site/pretty_urls', False) | |
48 | |
49 out_dir = (ctx.args.output or | 40 out_dir = (ctx.args.output or |
50 os.path.join(ctx.app.root_dir, '_counter')) | 41 os.path.join(ctx.app.root_dir, '_counter')) |
51 | 42 |
52 start_time = time.clock() | 43 start_time = time.clock() |
53 try: | 44 try: |
72 def _bakeSources(self, ctx, out_dir): | 63 def _bakeSources(self, ctx, out_dir): |
73 num_workers = ctx.app.config.get('baker/workers') or 4 | 64 num_workers = ctx.app.config.get('baker/workers') or 4 |
74 baker = Baker( | 65 baker = Baker( |
75 ctx.app, out_dir, | 66 ctx.app, out_dir, |
76 force=ctx.args.force, | 67 force=ctx.args.force, |
77 portable=ctx.args.portable, | |
78 no_assets=ctx.args.no_assets, | 68 no_assets=ctx.args.no_assets, |
79 num_workers=num_workers) | 69 num_workers=num_workers) |
80 baker.bake() | 70 baker.bake() |
81 | 71 |
82 def _bakeAssets(self, ctx, out_dir): | 72 def _bakeAssets(self, ctx, out_dir): |