Mercurial > piecrust2
view tests/pathutil.py @ 874:f4608e2e80ce
data: Optimize page data creation.
`datetime.strftime` was pretty costly so it's no lazily-computed in some
places, and replaced with some better alternative elsewhere.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 15 Jun 2017 07:31:50 -0700 |
parents | a2d283d1033d |
children |
line wrap: on
line source
import os def slashfix(path): if path is None: return None if isinstance(path, str): return path.replace('/', os.sep) fixed = [] for p in path: fixed.append(p.replace('/', os.sep)) return fixed