Skip to content

Commit

Permalink
Fixes for new flake8 checks
Browse files Browse the repository at this point in the history
  • Loading branch information
JayH5 committed May 10, 2016
1 parent 8e09cad commit 0338854
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions consular/clients.py
@@ -1,5 +1,6 @@
from urllib import quote, urlencode
import json
import treq

from twisted.internet import reactor
from twisted.python import log
Expand All @@ -9,14 +10,11 @@
# Twisted's default HTTP11 client factory is way too verbose
client._HTTP11ClientFactory.noisy = False

import treq


class JsonClient(object):
debug = False
clock = reactor
timeout = 5
requester = lambda self, *a, **kw: treq.request(*a, **kw)

def __init__(self, endpoint):
"""
Expand All @@ -25,6 +23,9 @@ def __init__(self, endpoint):
self.endpoint = endpoint
self.pool = client.HTTPConnectionPool(self.clock, persistent=False)

def requester(self, *args, **kwargs):
return treq.request(*args, **kwargs)

def _log_http_response(self, response, method, path, data):
log.msg('%s %s with %s returned: %s' % (
method, path, data, response.code))
Expand Down

0 comments on commit 0338854

Please sign in to comment.