view tests/pathutil.py @ 597:79a31a3c947b

admin: Better production config for FoodTruck, provide proper first site. * Use a `settings` object to configure Flask. * Accept an `app.cfg` file in the admin folder to configure Flask. * Get a proper first site name when the cookie isn't set yet.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 20 Jan 2016 21:39:18 -0800
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