Mercurial > piecrust2
comparison piecrust/baking/records.py @ 23:923699e816d0
Don't try to get the name of a source that doesn't have one.
TODO: clean up code duplication.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 19 Aug 2014 08:34:16 -0700 |
parents | 343d08ef5668 |
children | 2fec3ee1298f |
comparison
equal
deleted
inserted
replaced
22:df790a827d38 | 23:923699e816d0 |
---|---|
1 import logging | 1 import logging |
2 from piecrust.sources.base import PageSource | |
2 from piecrust.records import Record | 3 from piecrust.records import Record |
3 | 4 |
4 | 5 |
5 logger = logging.getLogger(__name__) | 6 logger = logging.getLogger(__name__) |
6 | 7 |
49 | 50 |
50 @property | 51 @property |
51 def transition_key(self): | 52 def transition_key(self): |
52 return _get_transition_key(self.source_name, self.rel_path, | 53 return _get_transition_key(self.source_name, self.rel_path, |
53 self.taxonomy_name, self.taxonomy_term) | 54 self.taxonomy_name, self.taxonomy_term) |
55 | |
56 def addUsedSource(self, source): | |
57 if isinstance(source, PageSource): | |
58 self.used_source_names.add(source.name) | |
59 | |
54 | 60 |
55 class TransitionalBakeRecord(object): | 61 class TransitionalBakeRecord(object): |
56 DELETION_MISSING = 1 | 62 DELETION_MISSING = 1 |
57 DELETION_CHANGED = 2 | 63 DELETION_CHANGED = 2 |
58 | 64 |