ext: Support multiple frontends/backends in an extension
This commit is contained in:
parent
0ec989d2cb
commit
64b0cc7b98
@ -265,13 +265,13 @@ meaningful defaults blank, like ``username`` and ``password``.
|
||||
# You will typically only implement one of the next three methods
|
||||
# in a single extension.
|
||||
|
||||
def get_frontend_class(self):
|
||||
def get_frontend_classes(self):
|
||||
from .frontend import SoundspotFrontend
|
||||
return SoundspotFrontend
|
||||
return [SoundspotFrontend]
|
||||
|
||||
def get_backend_class(self):
|
||||
def get_backend_classes(self):
|
||||
from .backend import SoundspotBackend
|
||||
return SoundspotBackend
|
||||
return [SoundspotBackend]
|
||||
|
||||
def register_gstreamer_elements(self):
|
||||
from .mixer import SoundspotMixer
|
||||
|
||||
@ -17,11 +17,11 @@ class Extension(object):
|
||||
def validate_environment(self):
|
||||
pass
|
||||
|
||||
def get_frontend_class(self):
|
||||
pass
|
||||
def get_frontend_classes(self):
|
||||
return []
|
||||
|
||||
def get_backend_class(self):
|
||||
pass
|
||||
def get_backend_classes(self):
|
||||
return []
|
||||
|
||||
def register_gstreamer_elements(self):
|
||||
pass
|
||||
|
||||
@ -24,11 +24,11 @@ class ExtensionTest(unittest.TestCase):
|
||||
def test_validate_environment_does_nothing_by_default(self):
|
||||
self.assertIsNone(self.ext.validate_environment())
|
||||
|
||||
def test_get_frontend_class_returns_none_by_default(self):
|
||||
self.assertIsNone(self.ext.get_frontend_class())
|
||||
def test_get_frontend_classes_returns_an_empty_list(self):
|
||||
self.assertListEqual(self.ext.get_frontend_classes(), [])
|
||||
|
||||
def test_get_backend_class_returns_none_by_default(self):
|
||||
self.assertIsNone(self.ext.get_backend_class())
|
||||
def test_get_backend_classes_returns_an_empty_list(self):
|
||||
self.assertListEqual(self.ext.get_backend_classes(), [])
|
||||
|
||||
def test_register_gstreamer_elements_does_nothing_by_default(self):
|
||||
self.assertIsNone(self.ext.register_gstreamer_elements())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user