From: Marek Marecki Date: Tue, 30 Apr 2013 21:09:20 +0000 (+0200) Subject: Updated manual X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=cdbe5f4e3c33205d885963aa676e773ebc92fd50;p=diaspy.git Updated manual --- diff --git a/manual/connecting_to_pod.mdown b/manual/connecting_to_pod.mdown index 9c2de82..5bfe50a 100644 --- a/manual/connecting_to_pod.mdown +++ b/manual/connecting_to_pod.mdown @@ -10,3 +10,7 @@ Then, if no errors are raised, you can `_login()` to the pod with given username If everything worked you are now connected to D\* pod at given URL. + +---- + +###### Manual for `diaspy`, written by Marek Marecki diff --git a/manual/connection.mdown b/manual/connection.mdown index f5219a9..723ba82 100644 --- a/manual/connection.mdown +++ b/manual/connection.mdown @@ -80,3 +80,6 @@ connection is broken. If you want to write your own interface or client for D\* `Connection()` will be the only object you need. +---- + +###### Manual for `diaspy`, written by Marek Marecki diff --git a/manual/stream.mdown b/manual/stream.mdown index 7be4c36..eca2677 100644 --- a/manual/stream.mdown +++ b/manual/stream.mdown @@ -24,9 +24,37 @@ Now you have a stream filled with posts (if any can be found on user's stream). ---- -##### Length of a stream +##### `fill()` and `update()` + +When you want to refresh stream call it's `fill()` method. It will overwrite old stream +contents. + +On the contrary, `update()` will get a new stream but will not overwrite old stream saved +in the object memory. It will append every new post to the old stream. + +---- + +##### Length of and iterating over a stream Stream's length can be checked by calling `len()` on it. len(stream) 10 + +When you want to iterate over a stream (e.g. when you want to print first *n* posts on +the stream) you can do it in two ways. + +First, using `len()` and `range()` functions. + + for i in range(len(stream)): + # do stuff... + +Second, iterating directly over the stream contents: + + for post in stream: + # do stuff... + + +---- + +###### Manual for `diaspy`, written by Marek Marecki