comparison piecrust/pipelines/_procrecords.py @ 852:4850f8c21b6e

core: Start of the big refactor for PieCrust 3.0. * Everything is a `ContentSource`, including assets directories. * Most content sources are subclasses of the base file-system source. * A source is processed by a "pipeline", and there are 2 built-in pipelines, one for assets and one for pages. The asset pipeline is vaguely functional, but the page pipeline is completely broken right now. * Rewrite the baking process as just running appropriate pipelines on each content item. This should allow for better parallelization.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 17 May 2017 00:11:48 -0700
parents
children f070a4fc033c
comparison
equal deleted inserted replaced
851:2c7e57d80bba 852:4850f8c21b6e
1 from piecrust.pipelines.records import RecordEntry
2
3
4 class AssetPipelineRecordEntry(RecordEntry):
5 FLAG_NONE = 0
6 FLAG_PREPARED = 2**0
7 FLAG_PROCESSED = 2**1
8 FLAG_BYPASSED_STRUCTURED_PROCESSING = 2**3
9 FLAG_COLLAPSED_FROM_LAST_RUN = 2**4
10
11 def __init__(self):
12 super().__init__()
13 self.out_paths = []
14 self.flags = self.FLAG_NONE
15 self.proc_tree = None
16
17 @property
18 def was_prepared(self):
19 return bool(self.flags & self.FLAG_PREPARED)
20
21 @property
22 def was_processed(self):
23 return (self.was_prepared and
24 (bool(self.flags & self.FLAG_PROCESSED) or
25 len(self.errors) > 0))
26
27 @property
28 def was_processed_successfully(self):
29 return self.was_processed and not self.errors
30
31 @property
32 def was_collapsed_from_last_run(self):
33 return self.flags & self.FLAG_COLLAPSED_FROM_LAST_RUN
34
35