Mercurial > piecrust2
comparison piecrust/sources/fs.py @ 866:d9059257743c
refactor: Make the linker work again.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 12 Jun 2017 22:10:50 -0700 |
parents | fddaf43424e2 |
children | 7e7fc7926307 |
comparison
equal
deleted
inserted
replaced
865:1bb0d973dc69 | 866:d9059257743c |
---|---|
137 return {} | 137 return {} |
138 | 138 |
139 def _finalizeContent(self, parent_group, items, groups): | 139 def _finalizeContent(self, parent_group, items, groups): |
140 pass | 140 pass |
141 | 141 |
142 def findGroup(self, rel_spec): | |
143 path = os.path.join(self.fs_endpoint_path, rel_spec) | |
144 if os.path.isdir(path): | |
145 metadata = self._createGroupMetadata(path) | |
146 return ContentGroup(path, metadata) | |
147 return None | |
148 | |
142 def getRelatedContents(self, item, relationship): | 149 def getRelatedContents(self, item, relationship): |
143 if relationship == REL_LOGICAL_PARENT_ITEM: | 150 if relationship == REL_LOGICAL_PARENT_ITEM: |
144 # If we want the logical parent item of a folder, we find a | 151 # If we want the logical parent item of a folder, we find a |
145 # page file with the same name as the folder. | 152 # page file with the same name as the folder. |
146 if not item.is_group: | 153 if not item.is_group: |
163 return [ContentGroup(dir_path, metadata)] | 170 return [ContentGroup(dir_path, metadata)] |
164 return None | 171 return None |
165 | 172 |
166 return None | 173 return None |
167 | 174 |
168 def findContent(self, route_params): | |
169 rel_path = route_params['path'] | |
170 path = os.path.join(self.fs_endpoint_path, rel_path) | |
171 metadata = self._createItemMetadata(path) | |
172 return ContentItem(path, metadata) | |
173 | |
174 def getSupportedRouteParameters(self): | 175 def getSupportedRouteParameters(self): |
175 return [ | 176 return [ |
176 RouteParameter('path', RouteParameter.TYPE_PATH)] | 177 RouteParameter('path', RouteParameter.TYPE_PATH)] |
177 | 178 |
178 | 179 |