mediachain / oldchain-client

[DEPRECATED] old mediachain client experiments
MIT License
4 stars 2 forks source link

Update to handle PR merge for better spec/test compliance on py-ipfs-api repo #95

Closed joshisa closed 8 years ago

joshisa commented 8 years ago

With recent updates/fixes to the py-ipfs-api repo, a list is no longer returned. Without this PR, if a user chooses to install the latest py-ipfs-api repo, a traceback will result within the mediachain-client during ingest as follows:

[....]
  File "/Users/.../site-packages/mediachain/writer/writer.py", line 83, in write_dataset
    raw, local_assets)
  File "/Users/.../site-packages/mediachain/writer/writer.py", line 97, in submit_translator_output
    raw_ref = self.store_raw(raw_content)
  File "/Users/.../site-packages/mediachain/writer/writer.py", line 168, in store_raw
    ref = store.put(raw_content)
  File "/Users/.../site-packages/mediachain/datastore/ipfs.py", line 59, in put
    header = result.pop(0)
KeyError: 0

I've attempted to maintain backwards compatibility with the old behavior (py-ipfs-api <= 0.2.3) and still work with the new and improved py-ipfs-api repo behavior.

yusefnapora commented 8 years ago

Awesome, thanks @joshisa 😄