Show More
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
@@ -67,7 +67,8 b' class Audio(DisplayObject):' | |||||
67 | Audio(data=b'RAW_WAV_DATA..) |
|
67 | Audio(data=b'RAW_WAV_DATA..) | |
68 |
|
68 | |||
69 | """ |
|
69 | """ | |
70 |
|
70 | _read_flags = 'rb' | ||
|
71 | ||||
71 | def __init__(self, data=None, filename=None, url=None, embed=None, rate=None, autoplay=False): |
|
72 | def __init__(self, data=None, filename=None, url=None, embed=None, rate=None, autoplay=False): | |
72 | if filename is None and url is None and data is None: |
|
73 | if filename is None and url is None and data is None: | |
73 | raise ValueError("No image data found. Expecting filename, url, or data.") |
|
74 | raise ValueError("No image data found. Expecting filename, url, or data.") |
@@ -14,13 +14,14 b'' | |||||
14 | #----------------------------------------------------------------------------- |
|
14 | #----------------------------------------------------------------------------- | |
15 | from __future__ import print_function |
|
15 | from __future__ import print_function | |
16 | from tempfile import NamedTemporaryFile, mkdtemp |
|
16 | from tempfile import NamedTemporaryFile, mkdtemp | |
17 | from os.path import split |
|
17 | from os.path import split, join as pjoin, dirname | |
18 |
|
18 | |||
19 | # Third-party imports |
|
19 | # Third-party imports | |
20 | import nose.tools as nt |
|
20 | import nose.tools as nt | |
21 |
|
21 | |||
22 | # Our own imports |
|
22 | # Our own imports | |
23 | from IPython.lib import display |
|
23 | from IPython.lib import display | |
|
24 | from IPython.testing.decorators import skipif_not_numpy | |||
24 |
|
25 | |||
25 | #----------------------------------------------------------------------------- |
|
26 | #----------------------------------------------------------------------------- | |
26 | # Classes and functions |
|
27 | # Classes and functions | |
@@ -155,3 +156,7 b' def test_error_on_file_to_FileLinks():' | |||||
155 | tf1 = NamedTemporaryFile(dir=td) |
|
156 | tf1 = NamedTemporaryFile(dir=td) | |
156 | nt.assert_raises(ValueError,display.FileLinks,tf1.name) |
|
157 | nt.assert_raises(ValueError,display.FileLinks,tf1.name) | |
157 |
|
158 | |||
|
159 | @skipif_not_numpy | |||
|
160 | def test_audio_from_file(): | |||
|
161 | path = pjoin(dirname(__file__), 'test.wav') | |||
|
162 | display.Audio(filename=path) No newline at end of file |
@@ -151,6 +151,7 b' def find_package_data():' | |||||
151 | package_data = { |
|
151 | package_data = { | |
152 | 'IPython.config.profile' : ['README*', '*/*.py'], |
|
152 | 'IPython.config.profile' : ['README*', '*/*.py'], | |
153 | 'IPython.core.tests' : ['*.png', '*.jpg'], |
|
153 | 'IPython.core.tests' : ['*.png', '*.jpg'], | |
|
154 | 'IPython.lib.tests' : ['*.wav'], | |||
154 | 'IPython.testing' : ['*.txt'], |
|
155 | 'IPython.testing' : ['*.txt'], | |
155 | 'IPython.testing.plugin' : ['*.txt'], |
|
156 | 'IPython.testing.plugin' : ['*.txt'], | |
156 | 'IPython.html' : ['templates/*'] + static_data, |
|
157 | 'IPython.html' : ['templates/*'] + static_data, |
General Comments 0
You need to be logged in to leave comments.
Login now