Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit e084615

Browse files
committed
Add serches endpoint, db() local_options
1 parent 4fe2e8c commit e084615

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

orbitdbapi/client.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _call(self, method, endpoint, **kwargs):
4949
result = res.json()
5050
except:
5151
self.logger.warning('Json decode error', exc_info=True)
52-
self.logger.debug(res.text)
52+
self.logger.log(15, res.text)
5353
raise
5454
try:
5555
res.raise_for_status()
@@ -62,9 +62,14 @@ def _call(self, method, endpoint, **kwargs):
6262
def list_dbs(self):
6363
return self._call('GET', 'dbs')
6464

65-
def db(self, dbname, **kwargs):
66-
return DB(self, self.open_db(dbname, **kwargs), **self.__config)
65+
def db(self, dbname, local_options=None, **kwargs):
66+
if local_options is None: local_options = {}
67+
return DB(self, self.open_db(dbname, **kwargs), **{**self.__config, **local_options})
6768

6869
def open_db(self, dbname, **kwargs):
6970
endpoint = '/'.join(['db', urlquote(dbname, safe='')])
7071
return self._call('POST', endpoint, **kwargs)
72+
73+
def searches(self):
74+
endpoint = '/'.join(['peers', 'searches'])
75+
return self._call('GET', endpoint)

0 commit comments

Comments
 (0)