comparison piecrust/processing/records.py @ 133:9e4c2e68a129

Optimize server for files that already exist. * Only try to find new assets if no previously existing asset or page could be used. * Tidy up a bit the API for passing and returning bake/process records. * Put the process record in its place.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 18 Nov 2014 21:32:04 -0800
parents 133845647083
children 308d5180bf81
comparison
equal deleted inserted replaced
132:3834e2ef0cf2 133:9e4c2e68a129
18 for entry in self.entries: 18 for entry in self.entries:
19 for out_path in entry.rel_outputs: 19 for out_path in entry.rel_outputs:
20 if out_path.lower() == rel_path: 20 if out_path.lower() == rel_path:
21 return entry 21 return entry
22 return None 22 return None
23
24 def replaceEntry(self, new_entry):
25 for e in self.entries:
26 if (e.base_dir == new_entry.base_dir and
27 e.rel_input == new_entry.rel_input):
28 e.flags = new_entry.flags
29 e.rel_outputs = list(new_entry.rel_outputs)
30 e.errors = list(new_entry.errors)
31 break
23 32
24 33
25 FLAG_NONE = 0 34 FLAG_NONE = 0
26 FLAG_PROCESSED = 2**0 35 FLAG_PROCESSED = 2**0
27 FLAG_OVERRIDEN = 2**1 36 FLAG_OVERRIDEN = 2**1