Flake8 cleanup. Setup environmental variables.

Skipping broken tests unrelated.
This commit is contained in:
Jakob Bowyer
2017-03-28 10:50:09 +01:00
parent 1787f8617f
commit 42ba5298a7
5 changed files with 60 additions and 36 deletions

View File

@@ -1,5 +1,6 @@
from mimetypes import guess_type
from os import path
try:
from ujson import dumps as json_dumps
except:
@@ -167,12 +168,12 @@ class StreamingHTTPResponse(BaseHTTPResponse):
return (b'HTTP/%b %d %b\r\n'
b'%b'
b'%b\r\n') % (
version.encode(),
self.status,
status,
timeout_header,
headers
)
version.encode(),
self.status,
status,
timeout_header,
headers
)
class HTTPResponse(BaseHTTPResponse):
@@ -216,14 +217,14 @@ class HTTPResponse(BaseHTTPResponse):
b'%b'
b'%b\r\n'
b'%b') % (
version.encode(),
self.status,
status,
b'keep-alive' if keep_alive else b'close',
timeout_header,
headers,
self.body
)
version.encode(),
self.status,
status,
b'keep-alive' if keep_alive else b'close',
timeout_header,
headers,
self.body
)
@property
def cookies(self):
@@ -331,7 +332,11 @@ def stream(
:param headers: Custom Headers.
"""
return StreamingHTTPResponse(
streaming_fn, headers=headers, content_type=content_type, status=status)
streaming_fn,
headers=headers,
content_type=content_type,
status=status
)
def redirect(to, headers=None, status=302,