Mercurial > piecrust2
diff 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 |
line wrap: on
line diff
--- a/piecrust/baking/records.py Mon Aug 18 23:20:43 2014 -0700 +++ b/piecrust/baking/records.py Tue Aug 19 08:34:16 2014 -0700 @@ -1,4 +1,5 @@ import logging +from piecrust.sources.base import PageSource from piecrust.records import Record @@ -52,6 +53,11 @@ return _get_transition_key(self.source_name, self.rel_path, self.taxonomy_name, self.taxonomy_term) + def addUsedSource(self, source): + if isinstance(source, PageSource): + self.used_source_names.add(source.name) + + class TransitionalBakeRecord(object): DELETION_MISSING = 1 DELETION_CHANGED = 2