Skip to content

Commit

Permalink
Merge branch 'develop' into jtyler/isort-experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed May 21, 2019
2 parents 49acf9e + 1a620cd commit 6b72bfb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions hug/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def decorator(middleware_method):
class MiddlewareRouter(object):
__slots__ = ()

def process_response(self, request, response, resource, req_succeeded):
def process_response(self, request, response, resource, _req_succeeded):
return middleware_method(request, response, resource)

apply_to_api.http.add_middleware(MiddlewareRouter())
Expand All @@ -179,7 +179,7 @@ def process_request(self, request, response):
self.gen = middleware_generator(request)
return self.gen.__next__()

def process_response(self, request, response, resource, req_succeeded):
def process_response(self, request, response, resource, _req_succeeded):
return self.gen.send((response, resource))

apply_to_api.http.add_middleware(MiddlewareRouter())
Expand Down
6 changes: 3 additions & 3 deletions hug/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def process_request(self, request, response):
data = self.store.get(sid)
request.context.update({self.context_name: data})

def process_response(self, request, response, resource, req_succeeded):
def process_response(self, request, response, resource, _req_succeeded):
"""Save request context in coupled store object. Set cookie containing a session ID."""
sid = request.cookies.get(self.cookie_name, None)
if sid is None or not self.store.exists(sid):
Expand Down Expand Up @@ -138,7 +138,7 @@ def process_request(self, request, response):
)
)

def process_response(self, request, response, resource, req_succeeded):
def process_response(self, request, response, resource, _req_succeeded):
"""Logs the basic data returned by the API"""
self.logger.info(self._generate_combined_log(request, response))

Expand Down Expand Up @@ -176,7 +176,7 @@ def match_route(self, reqpath):

return reqpath

def process_response(self, request, response, resource, req_succeeded):
def process_response(self, request, response, resource, _req_succeeded):
"""Add CORS headers to the response"""
response.set_header("Access-Control-Allow-Credentials", str(self.allow_credentials).lower())

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ deps=
marshmallow >=3.0.0rc5

whitelist_externals=flake8
commands=isort -c hug/*py
commands=isort -c --diff --recursive hug

[testenv:pywin]
deps =-rrequirements/build_windows.txt
Expand Down

0 comments on commit 6b72bfb

Please sign in to comment.