pep8 cleanup

This commit is contained in:
2014-10-17 09:33:16 +02:00
parent 3ac7b75f52
commit d95a9f1d70
2 changed files with 15 additions and 11 deletions

View File

@@ -25,6 +25,7 @@ app = Flask(__name__)
api = Api(app)
auth = HTTPBasicAuth()
@api.representation('application/octet-stream')
def output_file(data, code, headers=None):
"""Makes a Flask response to return a file."""
@@ -32,12 +33,14 @@ def output_file(data, code, headers=None):
resp.headers.extend(headers or {})
return resp
@auth.get_password
def get_password(username):
if username == 'bam':
return 'bam'
return None
@auth.error_handler
def unauthorized():
return make_response(jsonify({'message': 'Unauthorized access'}), 403)
@@ -60,6 +63,7 @@ class FileAPI(Resource):
"""Downloads a file."""
decorators = [auth.login_required]
def __init__(self):
# self.reqparse = reqparse.RequestParser()
# self.reqparse.add_argument('path',