]> git.parisson.com Git - timeside.git/commitdiff
LiveDecoder : Add doc + doctest example
authorThomas Fillon <thomas@parisson.com>
Mon, 6 Jan 2014 12:44:46 +0000 (13:44 +0100)
committerThomas Fillon <thomas@parisson.com>
Mon, 6 Jan 2014 12:44:46 +0000 (13:44 +0100)
doc/source/api/decoder/index.rst
timeside/core.py
timeside/decoder/core.py

index ac081a5404d7e6430796e5c3895ef5b308988f58..5f06ac1c699156cb5374d53cac2f530ba7cda2ae 100644 (file)
@@ -24,3 +24,11 @@ Array Decoder
    :members:
    :undoc-members:
    :show-inheritance:
+
+Live Decoder
+=============
+
+.. autoclass:: LiveDecoder
+   :members:
+   :undoc-members:
+   :show-inheritance:
index 50f1f3b3c1508e2a1cc994cc678c790135c3c0d7..f16a14459f9e3c70d0ad0c7872515f7c993747b2 100644 (file)
@@ -304,7 +304,6 @@ class ProcessPipe(object):
 
         def signal_handler(signum, frame):
             source.stop()
-            signal.signal(signum, signal.SIG_DFL)
 
         signal.signal(signal.SIGINT, signal_handler)
 
index c86e134c39e8d1ec179aaf2c20a079549def1164..719175acd90e10515708c5432bf6d3e38ac5ef0e 100644 (file)
@@ -432,8 +432,24 @@ class LiveDecoder(Decoder):
         ----------
         num_buffers :
             Number of buffers to output before sending EOS (-1 = unlimited).
-            Allowed values: >= -1
-            Default value: -1
+            (Allowed values: >= -1, Default value: -1)
+
+
+        Examples
+        --------
+
+        >>> import timeside
+
+        >>> live = timeside.decoder.LiveDecoder(num_buffers=25)
+        >>> a = timeside.analyzer.Waveform()
+        >>> e = timeside.encoder.Mp3Encoder('test_live.mp3', overwrite=True)
+        >>> pipe = (live | a | e)
+        >>> pipe.run()
+
+        >>> import matplotlib.pyplot as plt # doctest: +SKIP
+        >>> plt.plot(a.results['waveform_analyzer'].time, # doctest: +SKIP
+                 a.results['waveform_analyzer'].data) # doctest: +SKIP
+        >>> plt.show() # doctest: +SKIP
 
         """