Exemplo n.º 1
0
def delete(service):
    """Delete a file."""
    filesystem = _build_filesystem(service)
    if filesystem.isdir(request.args.get('path')):
        filesystem.removedir(request.args.get('path'))
    else:
        filesystem.remove(request.args.get('path'))
    return redirect(url_for('cloudutils.view', service=service))
Exemplo n.º 2
0
def delete(service):
    """Delete a file."""
    filesystem = _build_filesystem(service)
    if filesystem.isdir(request.args.get('path')):
        filesystem.removedir(request.args.get('path'))
    else:
        filesystem.remove(request.args.get('path'))
    return redirect(url_for('cloudutils.view', service=service))
Exemplo n.º 3
0
def view(service):
    """View page."""
    try:
        filesystem = _build_filesystem(service)
    except Exception as e:
        current_app.logger.exception(e)
        raise

    return _build_page(filesystem, service)
Exemplo n.º 4
0
def view(service):
    """View page."""
    try:
        filesystem = _build_filesystem(service)
    except Exception as e:
        current_app.logger.exception(e)
        raise

    return _build_page(filesystem, service)
Exemplo n.º 5
0
def download(service):
    """Download a file."""
    filesystem = _build_filesystem(service)

    if filesystem.haspathurl(request.args.get('path')):
        url = filesystem.getpathurl(request.args.get('path'))
        return redirect(url)
    else:
        return make_response(filesystem.open(
            request.args.get('path'), 'rb').read())
Exemplo n.º 6
0
def download(service):
    """Download a file."""
    filesystem = _build_filesystem(service)

    if filesystem.haspathurl(request.args.get('path')):
        url = filesystem.getpathurl(request.args.get('path'))
        return redirect(url)
    else:
        return make_response(
            filesystem.open(request.args.get('path'), 'rb').read())
Exemplo n.º 7
0
def callback(service):
    """Check that we can build a filesystem from the given service."""
    _build_filesystem(service)
    return redirect(url_for('cloudutils.view', service=service))
Exemplo n.º 8
0
def callback(service):
    """Check that we can build a filesystem from the given service."""
    _build_filesystem(service)
    return redirect(url_for('cloudutils.view', service=service))