/usr/share/pyshared/couchdbkit/consumer/base.py is in python-couchdbkit 0.6.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # -*- coding: utf-8 -
#
# This file is part of couchdbkit released under the MIT license.
# See the NOTICE for more information.
def check_callable(cb):
if not callable(cb):
raise TypeError("callback isn't a callable")
class ConsumerBase(object):
def __init__(self, db, **kwargs):
self.db = db
def fetch(self, cb=None, **params):
resp = self.db.res.get("_changes", **params)
if cb is not None:
check_callable(cb)
cb(resp.json_body)
else:
return resp.json_body
def wait_once(self, cb=None, **params):
raise NotImplementedError
def wait(self, cb, **params):
raise NotImplementedError
def wait_once_async(self, cb, **params):
raise NotImplementedError
def wait_async(self, cb, **params):
raise NotImplementedError
|