comparison piecrust/sources/fs.py @ 1078:a6618fdab37e

sources: Fix some invalid relationship name.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 15 Feb 2018 21:15:13 -0800
parents 3678cddf99f9
children 4ea64255eadf
comparison
equal deleted inserted replaced
1077:c53af44457b6 1078:a6618fdab37e
5 import logging 5 import logging
6 from piecrust import osutil 6 from piecrust import osutil
7 from piecrust.routing import RouteParameter 7 from piecrust.routing import RouteParameter
8 from piecrust.sources.base import ( 8 from piecrust.sources.base import (
9 ContentItem, ContentGroup, ContentSource, 9 ContentItem, ContentGroup, ContentSource,
10 REL_PARENT_GROUP, REL_LOGICAL_PARENT_ITEM, REL_LOGICAl_CHILD_GROUP) 10 REL_PARENT_GROUP, REL_LOGICAL_PARENT_ITEM, REL_LOGICAL_CHILD_GROUP)
11 11
12 12
13 logger = logging.getLogger(__name__) 13 logger = logging.getLogger(__name__)
14 14
15 15
157 if os.path.isfile(n): 157 if os.path.isfile(n):
158 metadata = self._createItemMetadata(n) 158 metadata = self._createItemMetadata(n)
159 return ContentItem(n, metadata) 159 return ContentItem(n, metadata)
160 return None 160 return None
161 161
162 if relationship == REL_LOGICAl_CHILD_GROUP: 162 if relationship == REL_LOGICAL_CHILD_GROUP:
163 # If we want the children items of an item, we look for 163 # If we want the children items of an item, we look for
164 # a directory that has the same name as the item's file. 164 # a directory that has the same name as the item's file.
165 if item.is_group: 165 if item.is_group:
166 raise ValueError( 166 raise ValueError(
167 "'%s' is a content group and doesn't have a logical " 167 "'%s' is a content group and doesn't have a logical "