summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Unterwaditzer <markus@unterwaditzer.net>2018-12-15 10:55:28 -0800
committerMarkus Unterwaditzer <markus@unterwaditzer.net>2018-12-15 10:55:28 -0800
commitd9e787b7a75ce9e50a3537d379d8a767bab9117f (patch)
tree734aab0e8105eb4629685d152ef3ecea245e5fa7
parent4206873d63c461ffe6944029d36951514157928e (diff)
downloadraven-d9e787b7a75ce9e50a3537d379d8a767bab9117f.tar.gz
fix: Flake8 updates
-rw-r--r--conftest.py2
-rw-r--r--raven/base.py16
-rw-r--r--raven/breadcrumbs.py10
-rw-r--r--raven/contrib/django/client.py8
-rw-r--r--raven/contrib/django/serializers.py6
-rw-r--r--raven/contrib/zope/__init__.py4
-rw-r--r--raven/handlers/logging.py10
-rwxr-xr-xsetup.py6
8 files changed, 33 insertions, 29 deletions
diff --git a/conftest.py b/conftest.py
index 9d4ea05..e442eb3 100644
--- a/conftest.py
+++ b/conftest.py
@@ -44,7 +44,7 @@ except ImportError:
use_djcelery = True
try:
import djcelery # NOQA
- #INSTALLED_APPS.append('djcelery')
+ # INSTALLED_APPS.append('djcelery')
except ImportError:
use_djcelery = False
diff --git a/raven/base.py b/raven/base.py
index 949aaa3..699f027 100644
--- a/raven/base.py
+++ b/raven/base.py
@@ -173,10 +173,12 @@ class Client(object):
self.include_paths = set(o.get('include_paths') or [])
self.exclude_paths = set(o.get('exclude_paths') or [])
self.name = text_type(
- o.get('name') or os.environ.get('SENTRY_NAME') or
- o.get('machine') or defaults.NAME)
+ o.get('name') or os.environ.get('SENTRY_NAME')
+ or o.get('machine') or defaults.NAME
+ )
self.auto_log_stacks = bool(
- o.get('auto_log_stacks') or defaults.AUTO_LOG_STACKS)
+ o.get('auto_log_stacks') or defaults.AUTO_LOG_STACKS
+ )
self.capture_locals = bool(
o.get('capture_locals', defaults.CAPTURE_LOCALS))
self.string_max_length = int(
@@ -198,8 +200,8 @@ class Client(object):
self.environment = (
o.get('environment') or os.environ.get('SENTRY_ENVIRONMENT', None))
self.release = (
- o.get('release') or os.environ.get('SENTRY_RELEASE') or
- os.environ.get('HEROKU_SLUG_COMMIT'))
+ o.get('release') or os.environ.get('SENTRY_RELEASE')
+ or os.environ.get('HEROKU_SLUG_COMMIT'))
self.repos = self._format_repos(o.get('repos'))
self.sample_rate = (
o.get('sample_rate')
@@ -435,8 +437,8 @@ class Client(object):
frame['in_app'] = False
else:
frame['in_app'] = (
- any(path.startswith(x) for x in self.include_paths) and
- not any(path.startswith(x) for x in self.exclude_paths)
+ any(path.startswith(x) for x in self.include_paths)
+ and not any(path.startswith(x) for x in self.exclude_paths)
)
transaction = None
diff --git a/raven/breadcrumbs.py b/raven/breadcrumbs.py
index 99ff013..912a0f6 100644
--- a/raven/breadcrumbs.py
+++ b/raven/breadcrumbs.py
@@ -27,11 +27,11 @@ logger = logging.getLogger('raven')
def event_payload_considered_equal(a, b):
return (
- a['type'] == b['type'] and
- a['level'] == b['level'] and
- a['message'] == b['message'] and
- a['category'] == b['category'] and
- a['data'] == b['data']
+ a['type'] == b['type']
+ and a['level'] == b['level']
+ and a['message'] == b['message']
+ and a['category'] == b['category']
+ and a['data'] == b['data']
)
diff --git a/raven/contrib/django/client.py b/raven/contrib/django/client.py
index 84c4770..fa424bc 100644
--- a/raven/contrib/django/client.py
+++ b/raven/contrib/django/client.py
@@ -288,10 +288,10 @@ class DjangoClient(Client):
# template information. As of Django 1.9 or so the new
# template debug thing showed up.
if hasattr(exc_value, 'django_template_source') or \
- ((isinstance(exc_value, TemplateSyntaxError) and
- isinstance(getattr(exc_value, 'source', None),
- (tuple, list)) and
- isinstance(exc_value.source[0], Origin))) or \
+ ((isinstance(exc_value, TemplateSyntaxError)
+ and isinstance(getattr(exc_value, 'source', None),
+ (tuple, list))
+ and isinstance(exc_value.source[0], Origin))) or \
hasattr(exc_value, 'template_debug'):
source = getattr(exc_value, 'django_template_source',
getattr(exc_value, 'source', None))
diff --git a/raven/contrib/django/serializers.py b/raven/contrib/django/serializers.py
index 221c7a0..f18f283 100644
--- a/raven/contrib/django/serializers.py
+++ b/raven/contrib/django/serializers.py
@@ -25,9 +25,9 @@ class PromiseSerializer(Serializer):
return False
pre = value.__class__.__name__[1:]
- if not (hasattr(value, '%s__func' % pre) or
- hasattr(value, '%s__unicode_cast' % pre) or
- hasattr(value, '%s__text_cast' % pre)):
+ if not (hasattr(value, '%s__func' % pre)
+ or hasattr(value, '%s__unicode_cast' % pre)
+ or hasattr(value, '%s__text_cast' % pre)):
return False
return True
diff --git a/raven/contrib/zope/__init__.py b/raven/contrib/zope/__init__.py
index b134ed3..b103c6b 100644
--- a/raven/contrib/zope/__init__.py
+++ b/raven/contrib/zope/__init__.py
@@ -46,8 +46,8 @@ class ZopeSentryHandler(SentryHandler):
def can_record(self, record):
return not (
- record.name == 'raven' or
- record.name.startswith(('sentry.errors', 'raven.'))
+ record.name == 'raven'
+ or record.name.startswith(('sentry.errors', 'raven.'))
)
def emit(self, record):
diff --git a/raven/handlers/logging.py b/raven/handlers/logging.py
index 49a17ce..fac7bb5 100644
--- a/raven/handlers/logging.py
+++ b/raven/handlers/logging.py
@@ -81,8 +81,8 @@ class SentryHandler(logging.Handler, object):
def can_record(self, record):
return not (
- record.name == 'raven' or
- record.name.startswith(('sentry.errors', 'raven.'))
+ record.name == 'raven'
+ or record.name.startswith(('sentry.errors', 'raven.'))
)
def emit(self, record):
@@ -119,8 +119,10 @@ class SentryHandler(logging.Handler, object):
if not started:
f_globals = getattr(frame, 'f_globals', {})
module_name = f_globals.get('__name__', '')
- if ((last_mod and last_mod.startswith('logging')) and
- not module_name.startswith('logging')):
+ if (
+ last_mod and last_mod.startswith('logging')
+ and not module_name.startswith('logging')
+ ):
started = True
else:
last_mod = module_name
diff --git a/setup.py b/setup.py
index acf71e5..ef58946 100755
--- a/setup.py
+++ b/setup.py
@@ -92,9 +92,9 @@ tests_require = [
'anyjson',
'ZConfig',
] + (
- flask_requires + flask_tests_requires +
- sanic_requires + sanic_tests_requires +
- unittest2_requires + webpy_tests_requires
+ flask_requires + flask_tests_requires
+ + sanic_requires + sanic_tests_requires
+ + unittest2_requires + webpy_tests_requires
)