From 94eecc1ce5f3607dfd4c9d9a83942a1d68d2858b Mon Sep 17 00:00:00 2001 From: orsinium Date: Wed, 3 Jan 2018 17:58:52 +0500 Subject: [PATCH] flake8 fixes --- djburger/exceptions.py | 4 ++-- djburger/mocks.py | 2 -- djburger/parsers.py | 2 +- djburger/renderers.py | 6 +++--- djburger/utils.py | 2 +- djburger/views.py | 1 - 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/djburger/exceptions.py b/djburger/exceptions.py index 36cba8c..8ebe848 100644 --- a/djburger/exceptions.py +++ b/djburger/exceptions.py @@ -19,10 +19,10 @@ class StatusCodeError(ValidationError): :param \**kwargs: kwargs for ValidationError. """ - def __init__(self, status_code, **kwargs): + def __init__(self, status_code, msg, **kwargs): self.status_code = status_code self.msg = msg - super(StatusCodeError, self).__init__(**kwargs) + super(StatusCodeError, self).__init__(msg, **kwargs) class SubValidationError(ValidationError): diff --git a/djburger/mocks.py b/djburger/mocks.py index 6f8eb22..68c9213 100644 --- a/djburger/mocks.py +++ b/djburger/mocks.py @@ -1,6 +1,4 @@ - - class DjangoFormBase(object): def __init__(self, **kwargs): raise ImportError("Django is not installed yet") diff --git a/djburger/parsers.py b/djburger/parsers.py index 28850ca..57c8bc7 100644 --- a/djburger/parsers.py +++ b/djburger/parsers.py @@ -16,7 +16,7 @@ # BSON try: from bson import loads as _bson -except: +except ImportError: _bson = None diff --git a/djburger/renderers.py b/djburger/renderers.py index d004a02..e19c3e3 100644 --- a/djburger/renderers.py +++ b/djburger/renderers.py @@ -17,21 +17,21 @@ # PyYAML try: import yaml as _yaml -except: +except ImportError: _yaml = None # BSON try: import bson as _bson -except: +except ImportError: _bson = None # tablib try: from tablib import Dataset as _Tablib -except: +except ImportError: _Tablib = None # noQA diff --git a/djburger/utils.py b/djburger/utils.py index 9ce4217..5d33b6d 100644 --- a/djburger/utils.py +++ b/djburger/utils.py @@ -7,7 +7,7 @@ else: is_django_installed = True try: - from django.conf import settings + from django.conf import settings # noQA except ImproperlyConfigured: is_django_active = False else: diff --git a/djburger/views.py b/djburger/views.py index 2cde000..601d4a2 100644 --- a/djburger/views.py +++ b/djburger/views.py @@ -2,7 +2,6 @@ # built-in from collections import namedtuple -from functools import update_wrapper # project from .exceptions import StatusCodeError, SubValidationError from .parsers import Default as _DefaultParser