Mercurial > piecrust2
comparison piecrust/commands/builtin/scaffolding.py @ 534:5bbeb11fe8d9
bug: Fix crash running `chef help scaffolding` outside of a website.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 29 Jul 2015 09:10:28 -0700 |
parents | dd25bd3ce1f9 |
children | 03c3a77fda60 |
comparison
equal
deleted
inserted
replaced
533:c24aaaf59500 | 534:5bbeb11fe8d9 |
---|---|
139 | 139 |
140 def _getTemplatesDir(self, app): | 140 def _getTemplatesDir(self, app): |
141 return os.path.join(app.root_dir, 'scaffold/pages') | 141 return os.path.join(app.root_dir, 'scaffold/pages') |
142 | 142 |
143 def supports(self, app): | 143 def supports(self, app): |
144 if not app.root_dir: | |
145 return False | |
144 return os.path.isdir(self._getTemplatesDir(app)) | 146 return os.path.isdir(self._getTemplatesDir(app)) |
145 | 147 |
146 def getTemplateNames(self, app): | 148 def getTemplateNames(self, app): |
147 names = os.listdir(self._getTemplatesDir(app)) | 149 names = os.listdir(self._getTemplatesDir(app)) |
148 return map(lambda n: os.path.splitext(n)[0], names) | 150 return map(lambda n: os.path.splitext(n)[0], names) |