view tests/pathutil.py @ 969:5b735229b6fb

admin: Micropub improvements. - Add support for Micropub media endpoint. - Add support for uploading photos via the endpoint. - Fix URL returned after creating post. - Hack for Micro.blog access token problems. - Hack for bug in Flask-IndieAuth.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 08 Oct 2017 09:32:33 -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