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))
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))
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)
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)
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())
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())
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))
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))