Went on a PEP-8 rampage

This commit is contained in:
Joel Collins 2019-01-31 17:20:46 +00:00
parent f99ad30fb6
commit 0948c9308a
36 changed files with 186 additions and 218 deletions

View file

@ -2,6 +2,7 @@ from flask import jsonify
from werkzeug.exceptions import default_exceptions
from werkzeug.exceptions import HTTPException
class JSONExceptionHandler(object):
def __init__(self, app=None):
@ -24,7 +25,6 @@ class JSONExceptionHandler(object):
}
return jsonify(response)
def init_app(self, app):
self.app = app
self.register(HTTPException)
@ -32,4 +32,4 @@ class JSONExceptionHandler(object):
self.register(code)
def register(self, exception_or_code, handler=None):
self.app.errorhandler(exception_or_code)(handler or self.std_handler)
self.app.errorhandler(exception_or_code)(handler or self.std_handler)