(path)
return slug, abspath
Parse the path into abspath and slug
Parse the path into abspath and slug
Parse the path into abspath and slug
def parse_path(path):
    """
    Parse the path into abspath and slug
    """
    bits = path.split('/')
    if len(bits) > 1:
        slug = bits[-1]
        path = '/'.join(bits[:-1])
        abspath = os.path.abspath(path)
    else:
        slug = path
        abspath = app_config.GRAPHICS_PATH
    return slug, abspath
def parse_path ( path ) : bits = path . split ( '/' ) if len ( bits ) > 1 : slug = bits [ - 1 ] path = '/' . join ( bits [ : - 1 ] ) abspath = os . path . abspath ( path ) else : slug = path abspath = app_config . GRAPHICS_PATH return slug , abspath