Skip to content

Commit b65a664

Browse files
author
Matt Curtis
committed
Satisfy pep8 warnings
1 parent c12963f commit b65a664

7 files changed

Lines changed: 14 additions & 14 deletions

File tree

fdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
def start(handle_code: customer_code.Function,
3030
uds: str,
31-
loop: asyncio.AbstractEventLoop=None):
31+
loop: asyncio.AbstractEventLoop = None):
3232
"""
3333
Unix domain socket HTTP server entry point
3434
:param handle_code: customer's code

fdk/async_http/response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def get_headers(
117117

118118
headers = self._parse_headers()
119119

120-
if self.status is 200:
120+
if self.status == 200:
121121
status = b"OK"
122122
else:
123123
status = STATUS_CODES.get(self.status)
@@ -227,7 +227,7 @@ def output(self, version="1.1", keep_alive=False, keep_alive_timeout=None):
227227

228228
headers = self._parse_headers()
229229

230-
if self.status is 200:
230+
if self.status == 200:
231231
status = b"OK"
232232
else:
233233
status = STATUS_CODES.get(self.status, b"UNKNOWN RESPONSE")

fdk/context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ def Method(self):
118118
return self._method
119119

120120
def __is_gateway(self):
121-
return (constants.FN_INTENT in self.__headers and
122-
self.__headers.get(constants.FN_INTENT) ==
123-
constants.INTENT_HTTP_REQUEST)
121+
return (constants.FN_INTENT in self.__headers
122+
and self.__headers.get(constants.FN_INTENT)
123+
== constants.INTENT_HTTP_REQUEST)
124124

125125

126126
def context_from_format(format_def: str, **kwargs) -> (

fdk/headers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def encap_headers(headers, status=None):
6262
k = k.lower()
6363
if k.startswith(constants.FN_HTTP_PREFIX): # by default merge
6464
push_header(new_headers, k, v)
65-
if (k == constants.CONTENT_TYPE or
66-
k == constants.FN_FDK_VERSION): # but don't merge these
65+
if (k == constants.CONTENT_TYPE
66+
or k == constants.FN_FDK_VERSION): # but don't merge these
6767
new_headers[k] = v
6868
else:
6969
push_header(new_headers, constants.FN_HTTP_PREFIX + k, v)

fdk/response.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
class Response(object):
2121

2222
def __init__(self, ctx: context.InvokeContext,
23-
response_data: Union[str, bytes]=None,
24-
headers: dict=None,
25-
status_code: int=200,
26-
response_encoding: str="utf-8"):
23+
response_data: Union[str, bytes] = None,
24+
headers: dict = None,
25+
status_code: int = 200,
26+
response_encoding: str = "utf-8"):
2727
"""
2828
Creates an FDK-readable response object
2929
:param ctx: invoke context

fdk/tests/tcp_debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from fdk.async_http import router
2424

2525

26-
def handle(handle_code: customer_code.Function, port: int=5000):
26+
def handle(handle_code: customer_code.Function, port: int = 5000):
2727
"""
2828
FDK entry point
2929
:param handle_code: customer's code

samples/echo/func.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from fdk import response
2121

2222

23-
def handler(ctx, data: io.BytesIO=None):
23+
def handler(ctx, data: io.BytesIO = None):
2424
name = "World"
2525
try:
2626
body = json.loads(data.getvalue())

0 commit comments

Comments
 (0)