Skip to content

Commit

Permalink
bump ver 0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
amstocker committed Mar 16, 2016
1 parent dc4d015 commit ab4094d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ipfsApi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from .client import *


__version__ = '0.2.2'
__version__ = '0.2.3'
14 changes: 10 additions & 4 deletions ipfsApi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from . import http, multipart, utils
from .commands import ArgCommand, Command, DownloadCommand, FileCommand

from .exceptions import ipfsApiError

default_host = 'localhost'
default_port = 5001
Expand Down Expand Up @@ -432,16 +432,22 @@ def dht_findpeer(self, *args, **kwargs):
"""
return self._dht_findpeer.request(self._client, *args, **kwargs)

@utils.return_field('Extra')
def dht_get(self, *args, **kwargs):
"""
"""
return self._dht_get.request(self._client, *args, **kwargs)
res = self._dht_get.request(self._client, *args, **kwargs)
if isinstance(res, dict) and "Extra" in res:
return res["Extra"]
else:
for r in res:
if "Extra" in r and len(r["Extra"]) > 0:
return r["Extra"]
raise ipfsApiError("empty response from DHT")

def dht_put(self, key, value, **kwargs):
"""
"""
return self._dht_put.request(self._client, [key, value], **kwargs)
return self._dht_put.request(self._client, key, value, **kwargs)

def ping(self, *args, **kwargs):
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.2.2',
version='0.2.3',

description='IPFS API Bindings for Python',

Expand Down

0 comments on commit ab4094d

Please sign in to comment.