Mercurial > piecrust2
comparison piecrust/sources/posts.py @ 926:86b684cc0551
sources: Add `findContentFromPath` API.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 01 Oct 2017 20:37:11 -0700 |
parents | c445a3d5d950 |
children | b61dd60aff36 |
comparison
equal
deleted
inserted
replaced
925:2394fd689590 | 926:86b684cc0551 |
---|---|
104 return None | 104 return None |
105 path = possible_paths[0] | 105 path = possible_paths[0] |
106 elif not os.path.isfile(path): | 106 elif not os.path.isfile(path): |
107 return None | 107 return None |
108 | 108 |
109 metadata = self._parseMetadataFromPath(path) | |
110 return ContentItem(path, metadata) | |
111 | |
112 def findContentFromPath(self, path): | |
109 metadata = self._parseMetadataFromPath(path) | 113 metadata = self._parseMetadataFromPath(path) |
110 return ContentItem(path, metadata) | 114 return ContentItem(path, metadata) |
111 | 115 |
112 def _parseMetadataFromPath(self, path): | 116 def _parseMetadataFromPath(self, path): |
113 regex_repl = { | 117 regex_repl = { |