Skip to content

Commit 3eb3429

Browse files
committed
Re-add the broken bitswap_unwant and file_ls methods
1 parent 7e8b402 commit 3eb3429

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

ipfsapi/client/__init__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,29 @@ def add(self, files, recursive=False, pattern='**', *args, **kwargs):
219219
return super(Client, self).add(*files, recursive=recursive, pattern=pattern, **kwargs)
220220

221221

222+
# Dropped API methods
223+
def bitswap_unwant(self, key, **kwargs):
224+
"""Deprecated method: Do not use anymore"""
225+
warnings.warn(
226+
"IPFS API function “bitswap_unwant” support has been dropped "
227+
"from go-ipfs", FutureWarning
228+
)
229+
230+
args = (key,)
231+
return self._client.request('/bitswap/unwant', args, **kwargs)
232+
233+
234+
def file_ls(self, multihash, **kwargs):
235+
"""Deprecated method: Replace usages with the similar “client.ls”"""
236+
warnings.warn(
237+
"IPFS API function “file_ls” support is highly deprecated and will "
238+
"be removed soon from go-ipfs, use plain “ls” instead", FutureWarning
239+
)
240+
241+
args = (multihash,)
242+
return self._client.request('/file/ls', args, decoder='json', **kwargs)
243+
244+
222245
# Dropped utility methods
223246
def add_pyobj(self, py_obj, **kwargs):
224247
"""Adds a picklable Python object as a file to IPFS.

0 commit comments

Comments
 (0)