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 Feb 16, 2016
1 parent 959d0a2 commit 3c68c28
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions consular/clients.py
Original file line number Diff line number Diff line change
@@ -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,15 +10,12 @@
# 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
agent = None
requester = lambda self, *a, **kw: treq.request(*a, **kw)

def __init__(self, endpoint):
"""
Expand All @@ -26,6 +24,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 3c68c28

Please sign in to comment.