예제 #1
0
파일: views.py 프로젝트: SCOAP3/invenio
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))
예제 #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))
예제 #3
0
파일: views.py 프로젝트: SCOAP3/invenio
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)
예제 #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)
예제 #5
0
파일: views.py 프로젝트: SCOAP3/invenio
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())
예제 #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())
예제 #7
0
파일: views.py 프로젝트: SCOAP3/invenio
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))
예제 #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))