Mercurial > piecrust2
comparison piecrust/sources/default.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 | 23052bf8a62b |
comparison
equal
deleted
inserted
replaced
925:2394fd689590 | 926:86b684cc0551 |
---|---|
86 if os.path.isfile(path): | 86 if os.path.isfile(path): |
87 metadata = self._doCreateItemMetadata(path) | 87 metadata = self._doCreateItemMetadata(path) |
88 return ContentItem(path, metadata) | 88 return ContentItem(path, metadata) |
89 return None | 89 return None |
90 | 90 |
91 def findContentFromPath(self, path): | |
92 metadata = self._doCreateItemMetadata(path) | |
93 return ContentItem(path, metadata) | |
94 | |
91 def setupPrepareParser(self, parser, app): | 95 def setupPrepareParser(self, parser, app): |
92 parser.add_argument('uri', help='The URI for the new page.') | 96 parser.add_argument('uri', help='The URI for the new page.') |
93 | 97 |
94 def createContent(self, args): | 98 def createContent(self, args): |
95 uri = args.get('uri') | 99 uri = args.get('uri') |