Merge pull request #1038 from jodal/feature/deps-executable-path
deps: Add executable path to 'mopidy deps' output
This commit is contained in:
commit
4b8cd3af87
@ -61,6 +61,10 @@ v0.20.0 (UNRELEASED)
|
||||
to set the log level for all loggers to the lowest possible value, including
|
||||
log records at levels lover than ``DEBUG`` too.
|
||||
|
||||
- Add path to the current ``mopidy`` executable to the output of ``mopidy
|
||||
deps``. This make it easier to see that a user is using pip-installed Mopidy
|
||||
instead of APT-installed Mopidy without asking for ``which mopidy`` output.
|
||||
|
||||
**Configuration**
|
||||
|
||||
- Add support for the log level value ``all`` to the loglevels configurations.
|
||||
|
||||
@ -3,6 +3,7 @@ from __future__ import absolute_import, unicode_literals
|
||||
import functools
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
import pygst
|
||||
pygst.require('0.10')
|
||||
@ -24,6 +25,7 @@ def format_dependency_list(adapters=None):
|
||||
for dist_name in dist_names]
|
||||
|
||||
adapters = [
|
||||
executable_info,
|
||||
platform_info,
|
||||
python_info,
|
||||
functools.partial(pkg_info, 'Mopidy', True)
|
||||
@ -63,6 +65,13 @@ def _format_dependency(dep_info):
|
||||
return '\n'.join(lines)
|
||||
|
||||
|
||||
def executable_info():
|
||||
return {
|
||||
'name': 'Executable',
|
||||
'version': sys.argv[0],
|
||||
}
|
||||
|
||||
|
||||
def platform_info():
|
||||
return {
|
||||
'name': 'Platform',
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import platform
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
import mock
|
||||
@ -46,6 +47,12 @@ class DepsTest(unittest.TestCase):
|
||||
self.assertIn(' pylast: 0.5', result)
|
||||
self.assertIn(' setuptools: 0.6', result)
|
||||
|
||||
def test_executable_info(self):
|
||||
result = deps.executable_info()
|
||||
|
||||
self.assertEqual('Executable', result['name'])
|
||||
self.assertIn(sys.argv[0], result['version'])
|
||||
|
||||
def test_platform_info(self):
|
||||
result = deps.platform_info()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user