view tests/pathutil.py @ 455:cb3446be44b7

bake: Abort "render first" jobs if we start using other pages. This prevents the baker from having one worker stuck on a very long job, like rendering the index page of a blog with lots and lots of posts.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 08 Jul 2015 22:51:29 -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