diff --git a/.travis.yml b/.travis.yml index 5fe539c..35da428 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,8 @@ deploy: - LICENSE - kwikapi/api.py - kwikapi/__init__.py - name: kwikapi-0.2.5 - tag_name: 0.2.5 + name: kwikapi-0.2.6 + tag_name: 0.2.6 on: repo: deep-compute/kwikapi - provider: pypi diff --git a/kwikapi/api.py b/kwikapi/api.py index 693184f..29bc4a3 100644 --- a/kwikapi/api.py +++ b/kwikapi/api.py @@ -58,7 +58,7 @@ def id(self): _id = self.headers.get(REQUEST_ID_HEADER, '') if _id: return '{}.{}'.format(_id, self._id) - return _id + return self._id @abc.abstractproperty def url(self): @@ -182,13 +182,13 @@ class API(object): THREADPOOL_SIZE = 32 - def __init__(self, default_version=None, _id='', + def __init__(self, default_version=None, id='', threadpool=None, threadpool_size=THREADPOOL_SIZE, log=DUMMY_LOG): self._api_funcs = {} - self.log = log.bind(api_id=_id) - self._id = _id + self.log = log.bind(api_id=id) + self._id = id self.default_version = default_version self.threadpool = None @@ -480,7 +480,7 @@ def handle_request(self, request): message = '[(%s) %s: %s]' % (self.api._id, e.__class__.__name__, message) _log = request.log if hasattr(request, 'log') else self.log - self.log.exception('handle_request_error', message=message) + _log.exception('handle_request_error', message=message) response.write(dict(success=False, message=message), protocol) response.flush() diff --git a/setup.py b/setup.py index a74b7c0..10f5847 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.2.5' +version = '0.2.6' setup( name="kwikapi", version=version,