Add Gstreamer adapter for --list-deps
This commit is contained in:
parent
a25e7d9530
commit
4c6a6af487
@ -1,5 +1,9 @@
|
||||
import sys
|
||||
|
||||
import pygst
|
||||
pygst.require('0.10')
|
||||
import gst
|
||||
|
||||
import pykka
|
||||
|
||||
from mopidy.utils.log import indent
|
||||
@ -19,6 +23,7 @@ def list_deps_optparse_callback(*args):
|
||||
def format_dependency_list(adapters=None):
|
||||
if adapters is None:
|
||||
adapters = [
|
||||
gstreamer_info,
|
||||
pykka_info,
|
||||
pyspotify_info,
|
||||
]
|
||||
@ -38,6 +43,16 @@ def format_dependency_list(adapters=None):
|
||||
return '\n'.join(lines)
|
||||
|
||||
|
||||
def gstreamer_info():
|
||||
return {
|
||||
'name': 'Gstreamer',
|
||||
'version': '.'.join(map(str, gst.get_gst_version())),
|
||||
'path': gst.__file__,
|
||||
'other': 'Python wrapper: gst-python %s' % (
|
||||
'.'.join(map(str, gst.get_pygst_version()))),
|
||||
}
|
||||
|
||||
|
||||
def pykka_info():
|
||||
if hasattr(pykka, '__version__'):
|
||||
# Pykka >= 0.14
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
import pygst
|
||||
pygst.require('0.10')
|
||||
import gst
|
||||
|
||||
import pykka
|
||||
import spotify
|
||||
|
||||
@ -22,6 +26,15 @@ class DepsTest(unittest.TestCase):
|
||||
self.assertIn('Imported from: /foo/bar/baz', result)
|
||||
self.assertIn('Quux', result)
|
||||
|
||||
def test_gstreamer_info(self):
|
||||
result = deps.gstreamer_info()
|
||||
|
||||
self.assertEquals('Gstreamer', result['name'])
|
||||
self.assertEquals('.'.join(map(str, gst.get_gst_version())), result['version'])
|
||||
self.assertIn('gst', result['path'])
|
||||
self.assertIn('Python wrapper: gst-python', result['other'])
|
||||
self.assertIn('.'.join(map(str, gst.get_pygst_version())), result['other'])
|
||||
|
||||
def test_pykka_info(self):
|
||||
result = deps.pykka_info()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user