Mercurial > piecrust2
comparison piecrust/baking/baker.py @ 205:e725af1d48fb
bake: Changes in how assets directories are configured.
Change `skip_patterns` and `force_patterns` to `ignore` and `force`.
Put less responsibility on the `bake` command to specify all those settings,
and more on the `Baker` and `ProcessorPipeline` themselves.
Add some tests.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 18 Jan 2015 12:12:57 -0800 |
parents | aaf08277b96d |
children | 1f4c3dae1fe8 |
comparison
equal
deleted
inserted
replaced
204:f98451237371 | 205:e725af1d48fb |
---|---|
16 | 16 |
17 logger = logging.getLogger(__name__) | 17 logger = logging.getLogger(__name__) |
18 | 18 |
19 | 19 |
20 class Baker(object): | 20 class Baker(object): |
21 def __init__(self, app, out_dir, force=False, | 21 def __init__(self, app, out_dir, force=False): |
22 no_assets=False, num_workers=4): | |
23 assert app and out_dir | 22 assert app and out_dir |
24 self.app = app | 23 self.app = app |
25 self.out_dir = out_dir | 24 self.out_dir = out_dir |
26 self.force = force | 25 self.force = force |
27 self.no_assets = no_assets | 26 self.num_workers = app.config.get('baker/workers', 4) |
28 self.num_workers = num_workers | |
29 | 27 |
30 # Remember what taxonomy pages we should skip | 28 # Remember what taxonomy pages we should skip |
31 # (we'll bake them repeatedly later with each taxonomy term) | 29 # (we'll bake them repeatedly later with each taxonomy term) |
32 self.taxonomy_pages = [] | 30 self.taxonomy_pages = [] |
33 logger.debug("Gathering taxonomy page paths:") | 31 logger.debug("Gathering taxonomy page paths:") |