fix minor style offences

This commit is contained in:
Thomas Kriechbaumer 2015-08-10 20:50:05 +02:00
parent ff27d65f08
commit 6a30ad2ad2
3 changed files with 11 additions and 12 deletions

View File

@ -142,13 +142,13 @@ class HTTP2Protocol(semantics.ProtocolMixin):
headers = request.headers.copy()
if not ':authority' in headers.keys():
if ':authority' not in headers.keys():
headers.add(':authority', bytes(authority), prepend=True)
if not ':scheme' in headers.keys():
if ':scheme' not in headers.keys():
headers.add(':scheme', bytes(request.scheme), prepend=True)
if not ':path' in headers.keys():
if ':path' not in headers.keys():
headers.add(':path', bytes(request.path), prepend=True)
if not ':method' in headers.keys():
if ':method' not in headers.keys():
headers.add(':method', bytes(request.method), prepend=True)
headers = headers.items()
@ -167,7 +167,7 @@ class HTTP2Protocol(semantics.ProtocolMixin):
headers = response.headers.copy()
if not ':status' in headers.keys():
if ':status' not in headers.keys():
headers.add(':status', bytes(str(response.status_code)), prepend=True)
headers = headers.items()

View File

@ -15,10 +15,10 @@ CONTENT_MISSING = 0
class ProtocolMixin(object):
def read_request(self, *args, **kwargs): # pragma: no cover
raise NotImplemented
raise NotImplementedError
def read_response(self, *args, **kwargs): # pragma: no cover
raise NotImplemented
raise NotImplementedError
def assemble(self, message):
if isinstance(message, Request):
@ -28,11 +28,11 @@ class ProtocolMixin(object):
else:
raise ValueError("HTTP message not supported.")
def assemble_request(self, request): # pragma: no cover
raise NotImplemented
def assemble_request(self, *args, **kwargs): # pragma: no cover
raise NotImplementedError
def assemble_response(self, response): # pragma: no cover
raise NotImplemented
def assemble_response(self, *args, **kwargs): # pragma: no cover
raise NotImplementedError
class Request(object):

View File

@ -1,4 +1,3 @@
from netlib import utils, odict, tutils