Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

docs: Add 'Fetch Data' tutorial #289

Merged
merged 1 commit into from
Jan 16, 2020
Merged

Conversation

lzpap
Copy link
Member

@lzpap lzpap commented Jan 15, 2020

Related: #268 and #284

Description

  • Add Fetch Data tutorial to gather messages from the Tangle.
  • Introduce numbering in headings for tutorials.

Copy link
Contributor

@todofixthis todofixthis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Minor suggestions.

Comment on lines 25 to 28
data = tx.signature_message_fragment.decode()
# Ignore invalid or not unicode encoded data
except (TrytesDecodeError, UnicodeDecodeError):
continue
Copy link
Contributor

@todofixthis todofixthis Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can achieve basically the same result with:

data = tx.signature_message_fragment.decode(errors='ignore')

More info:
https://github.com/iotaledger/iota.py/blob/2.1.0/iota/types.py#L536-L547

(this is meant to mimic the way Python's codecs.decode() function works)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, however, with ignore, only the values that can't be decoded are dropped, the rest of the non-meaningful message will be printed.
Anyway, I added a small explanation and changed it to your suggestion.

- Introduce numbering in headings too.
@lzpap lzpap force-pushed the fetch_data_tutorial branch from d04a8d2 to c48d874 Compare January 16, 2020 09:35
@lzpap lzpap merged commit 5d9a950 into iotaledger:develop Jan 16, 2020
@lzpap lzpap deleted the fetch_data_tutorial branch January 28, 2020 10:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants