예제 #1
0
파일: deps.py 프로젝트: wsenfuma/mopidy
def gstreamer_info():
    other = []
    other.append(f"Python wrapper: python-gi {gi.__version__}")

    found_elements = []
    missing_elements = []
    for name, status in _gstreamer_check_elements():
        if status:
            found_elements.append(name)
        else:
            missing_elements.append(name)

    other.append("Relevant elements:")
    other.append("  Found:")
    for element in found_elements:
        other.append(f"    {element}")
    if not found_elements:
        other.append("    none")
    other.append("  Not found:")
    for element in missing_elements:
        other.append(f"    {element}")
    if not missing_elements:
        other.append("    none")

    return {
        "name": "GStreamer",
        "version": ".".join(map(str, Gst.version())),
        "path": os.path.dirname(gi.__file__),
        "other": "\n".join(other),
    }
예제 #2
0
def gstreamer_info():
    other = []
    other.append('Python wrapper: python-gi %s' % gi.__version__)

    found_elements = []
    missing_elements = []
    for name, status in _gstreamer_check_elements():
        if status:
            found_elements.append(name)
        else:
            missing_elements.append(name)

    other.append('Relevant elements:')
    other.append('  Found:')
    for element in found_elements:
        other.append('    %s' % element)
    if not found_elements:
        other.append('    none')
    other.append('  Not found:')
    for element in missing_elements:
        other.append('    %s' % element)
    if not missing_elements:
        other.append('    none')

    return {
        'name': 'GStreamer',
        'version': '.'.join(map(str, Gst.version())),
        'path': os.path.dirname(gi.__file__),
        'other': '\n'.join(other),
    }
예제 #3
0
def gstreamer_info():
    other = []
    other.append('Python wrapper: python-gi %s' % gi.__version__)

    found_elements = []
    missing_elements = []
    for name, status in _gstreamer_check_elements():
        if status:
            found_elements.append(name)
        else:
            missing_elements.append(name)

    other.append('Relevant elements:')
    other.append('  Found:')
    for element in found_elements:
        other.append('    %s' % element)
    if not found_elements:
        other.append('    none')
    other.append('  Not found:')
    for element in missing_elements:
        other.append('    %s' % element)
    if not missing_elements:
        other.append('    none')

    return {
        'name': 'GStreamer',
        'version': '.'.join(map(str, Gst.version())),
        'path': os.path.dirname(gi.__file__),
        'other': '\n'.join(other),
    }
예제 #4
0
    def test_gstreamer_info(self):
        result = deps.gstreamer_info()

        assert "GStreamer" == result["name"]
        assert ".".join(map(str, Gst.version())) == result["version"]
        assert "gi" in result["path"]
        assert "__init__.py" not in result["path"]
        assert "Python wrapper: python-gi" in result["other"]
        assert gi.__version__ in result["other"]
        assert "Relevant elements:" in result["other"]
예제 #5
0
    def test_gstreamer_info(self):
        result = deps.gstreamer_info()

        self.assertEqual('GStreamer', result['name'])
        self.assertEqual('.'.join(map(str, Gst.version())), result['version'])
        self.assertIn('gi', result['path'])
        self.assertNotIn('__init__.py', result['path'])
        self.assertIn('Python wrapper: python-gi', result['other'])
        self.assertIn(gi.__version__, result['other'])
        self.assertIn('Relevant elements:', result['other'])
예제 #6
0
    def test_gstreamer_info(self):
        result = deps.gstreamer_info()

        self.assertEqual('GStreamer', result['name'])
        self.assertEqual(
            '.'.join(map(str, Gst.version())), result['version'])
        self.assertIn('gi', result['path'])
        self.assertNotIn('__init__.py', result['path'])
        self.assertIn('Python wrapper: python-gi', result['other'])
        self.assertIn(gi.__version__, result['other'])
        self.assertIn('Relevant elements:', result['other'])