rename AudioStreamInfo into StreamInfo
Allowing future use with upcoming VideoStream Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
d34f8f2e40
commit
e7805cec12
10 changed files with 72 additions and 40 deletions
|
|
@ -18,37 +18,20 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from .base import CapBaseObject, Field, StringField
|
||||
from weboob.tools.capabilities.streaminfo import StreamInfo
|
||||
from .base import CapBaseObject, Field
|
||||
from .file import ICapFile
|
||||
from .audio import ICapAudio, BaseAudio
|
||||
|
||||
|
||||
__all__ = ['AudioStreamInfo', 'BaseAudioStream', 'ICapAudioStream']
|
||||
|
||||
|
||||
class AudioStreamInfo(CapBaseObject):
|
||||
"""
|
||||
AudioStream related information.
|
||||
"""
|
||||
who = StringField('Who is currently on air')
|
||||
what = StringField('What is currently on air')
|
||||
|
||||
def __iscomplete__(self):
|
||||
# This volatile information may be reloaded everytimes.
|
||||
return False
|
||||
|
||||
def __unicode__(self):
|
||||
if self.who:
|
||||
return u'%s - %s' % (self.who, self.what)
|
||||
else:
|
||||
return self.what
|
||||
__all__ = ['BaseAudioStream', 'ICapAudioStream']
|
||||
|
||||
|
||||
class BaseAudioStream(BaseAudio):
|
||||
"""
|
||||
Audio stream object
|
||||
"""
|
||||
current = Field('Information related to current broadcast', AudioStreamInfo)
|
||||
current = Field('Information related to current broadcast', StreamInfo)
|
||||
|
||||
def __unicode__(self):
|
||||
return u'%s (%s)' % (self.title, self.url)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
|
||||
from .base import IBaseCap, CapBaseObject, Field, StringField
|
||||
from .audiostream import AudioStreamInfo
|
||||
from weboob.tools.capabilities.streaminfo import StreamInfo
|
||||
|
||||
|
||||
__all__ = ['Radio', 'ICapRadio']
|
||||
|
|
@ -32,7 +32,7 @@ class Radio(CapBaseObject):
|
|||
"""
|
||||
title = StringField('Title of radio')
|
||||
description = StringField('Description of radio')
|
||||
current = Field('Current emission', AudioStreamInfo)
|
||||
current = Field('Current emission', StreamInfo)
|
||||
streams = Field('List of streams', list)
|
||||
|
||||
class ICapRadio(IBaseCap):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue