Mercurial > piecrust2
comparison piecrust/sources/base.py @ 30:4bd840ae75cd
Fix stupid bug in default source, add some unit tests.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 19 Aug 2014 12:46:55 -0700 |
parents | 105f24f490cb |
children | 485682a6de50 |
comparison
equal
deleted
inserted
replaced
29:7e44f6092a1d | 30:4bd840ae75cd |
---|---|
305 rel_dirpath = os.path.relpath(dirpath, self.fs_endpoint_path) | 305 rel_dirpath = os.path.relpath(dirpath, self.fs_endpoint_path) |
306 dirnames[:] = list(filter(self._filterPageDirname, dirnames)) | 306 dirnames[:] = list(filter(self._filterPageDirname, dirnames)) |
307 for f in filter(self._filterPageFilename, filenames): | 307 for f in filter(self._filterPageFilename, filenames): |
308 slug, ext = os.path.splitext(os.path.join(rel_dirpath, f)) | 308 slug, ext = os.path.splitext(os.path.join(rel_dirpath, f)) |
309 slug = slug.replace('\\', '/') | 309 slug = slug.replace('\\', '/') |
310 if ext not in self.supported_extensions: | 310 if ext.lstrip('.') not in self.supported_extensions: |
311 slug += ext | 311 slug += ext |
312 if slug.startswith('./') or slug.startswith('.\\'): | 312 if slug.startswith('./') or slug.startswith('.\\'): |
313 slug = slug[2:] | 313 slug = slug[2:] |
314 if slug == '_index': | 314 if slug == '_index': |
315 slug = '' | 315 slug = '' |