comparison piecrust/sources/base.py @ 84:b3ce11b2cf36

Don't complain about missing `pages` or `posts` directories by default.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 03 Sep 2014 17:26:38 -0700
parents 2fec3ee1298f
children 371a6c879ab9
comparison
equal deleted inserted replaced
82:ae90caf26224 84:b3ce11b2cf36
296 self.default_auto_format = app.config.get('site/default_auto_format') 296 self.default_auto_format = app.config.get('site/default_auto_format')
297 297
298 def buildPageFactories(self): 298 def buildPageFactories(self):
299 logger.debug("Scanning for pages in: %s" % self.fs_endpoint_path) 299 logger.debug("Scanning for pages in: %s" % self.fs_endpoint_path)
300 if not os.path.isdir(self.fs_endpoint_path): 300 if not os.path.isdir(self.fs_endpoint_path):
301 if self.ignore_missing_dir:
302 return
301 raise InvalidFileSystemEndpointError(self.name, self.fs_endpoint_path) 303 raise InvalidFileSystemEndpointError(self.name, self.fs_endpoint_path)
302 304
303 for dirpath, dirnames, filenames in os.walk(self.fs_endpoint_path): 305 for dirpath, dirnames, filenames in os.walk(self.fs_endpoint_path):
304 rel_dirpath = os.path.relpath(dirpath, self.fs_endpoint_path) 306 rel_dirpath = os.path.relpath(dirpath, self.fs_endpoint_path)
305 dirnames[:] = list(filter(self._filterPageDirname, dirnames)) 307 dirnames[:] = list(filter(self._filterPageDirname, dirnames))