aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-05-31 19:58:28 +1200
committerAldo Cortesi <aldo@nullcube.com>2016-05-31 19:58:28 +1200
commit40a030f215e1943aefdb2eb6fe2a264b9b1ee33c (patch)
tree534b800a2d5ddada0cae1f0a7bbeee22f23b94de
parentf62efed304d7ecd8f6149ff98577b381b4a3a3c9 (diff)
downloadmitmproxy-40a030f215e1943aefdb2eb6fe2a264b9b1ee33c.tar.gz
mitmproxy-40a030f215e1943aefdb2eb6fe2a264b9b1ee33c.tar.bz2
mitmproxy-40a030f215e1943aefdb2eb6fe2a264b9b1ee33c.zip
Satisfy flake8
-rw-r--r--netlib/basetypes.py1
-rw-r--r--netlib/http/headers.py2
-rw-r--r--netlib/http/url.py1
-rw-r--r--netlib/human.py2
-rw-r--r--netlib/utils.py1
-rw-r--r--test/netlib/http/test_multipart.py1
-rw-r--r--test/netlib/http/test_url.py1
-rw-r--r--test/netlib/test_basetypes.py1
-rw-r--r--test/netlib/test_human.py1
9 files changed, 9 insertions, 2 deletions
diff --git a/netlib/basetypes.py b/netlib/basetypes.py
index d03246ff..9d6c60ba 100644
--- a/netlib/basetypes.py
+++ b/netlib/basetypes.py
@@ -1,6 +1,7 @@
import six
import abc
+
@six.add_metaclass(abc.ABCMeta)
class Serializable(object):
"""
diff --git a/netlib/http/headers.py b/netlib/http/headers.py
index 8f669ec1..fa7b7180 100644
--- a/netlib/http/headers.py
+++ b/netlib/http/headers.py
@@ -176,7 +176,7 @@ class Headers(MultiDict):
self.fields = fields
return replacements
-
+
def parse_content_type(c):
"""
A simple parser for content-type values. Returns a (type, subtype,
diff --git a/netlib/http/url.py b/netlib/http/url.py
index 147ed572..8ce28578 100644
--- a/netlib/http/url.py
+++ b/netlib/http/url.py
@@ -3,6 +3,7 @@ from six.moves import urllib
from .. import utils
+
# PY2 workaround
def decode_parse_result(result, enc):
if hasattr(result, "decode"):
diff --git a/netlib/human.py b/netlib/human.py
index 9eccd35b..a007adc7 100644
--- a/netlib/human.py
+++ b/netlib/human.py
@@ -19,7 +19,7 @@ def pretty_size(size):
if x == int(x):
x = int(x)
return str(x) + suf
- return "%s%s"%(size, SIZE_TABLE[0][0])
+ return "%s%s" % (size, SIZE_TABLE[0][0])
def parse_size(s):
diff --git a/netlib/utils.py b/netlib/utils.py
index 6be1c17f..b8408d1d 100644
--- a/netlib/utils.py
+++ b/netlib/utils.py
@@ -8,6 +8,7 @@ import inspect
import six
+
def always_bytes(unicode_or_bytes, *encode_args):
if isinstance(unicode_or_bytes, six.text_type):
return unicode_or_bytes.encode(*encode_args)
diff --git a/test/netlib/http/test_multipart.py b/test/netlib/http/test_multipart.py
index 45ae996b..1d7e0062 100644
--- a/test/netlib/http/test_multipart.py
+++ b/test/netlib/http/test_multipart.py
@@ -1,6 +1,7 @@
from netlib.http import Headers
from netlib.http import multipart
+
def test_decode():
boundary = 'somefancyboundary'
headers = Headers(
diff --git a/test/netlib/http/test_url.py b/test/netlib/http/test_url.py
index 697c83a8..26b37230 100644
--- a/test/netlib/http/test_url.py
+++ b/test/netlib/http/test_url.py
@@ -1,6 +1,7 @@
from netlib import tutils
from netlib.http import url
+
def test_parse():
with tutils.raises(ValueError):
url.parse("")
diff --git a/test/netlib/test_basetypes.py b/test/netlib/test_basetypes.py
index 2a7eea81..aa415784 100644
--- a/test/netlib/test_basetypes.py
+++ b/test/netlib/test_basetypes.py
@@ -1,5 +1,6 @@
from netlib import basetypes
+
class SerializableDummy(basetypes.Serializable):
def __init__(self, i):
self.i = i
diff --git a/test/netlib/test_human.py b/test/netlib/test_human.py
index 464d4646..2a5c2a85 100644
--- a/test/netlib/test_human.py
+++ b/test/netlib/test_human.py
@@ -1,5 +1,6 @@
from netlib import human, tutils
+
def test_parse_size():
assert human.parse_size("0") == 0
assert human.parse_size("0b") == 0