Allow GStreamer to process --help-gst

This commit is contained in:
Stein Magnus Jodal 2011-05-09 23:13:06 +02:00
parent 644c87128b
commit f035ea31ef
2 changed files with 11 additions and 2 deletions

View File

@ -8,8 +8,10 @@ import time
# so that GStreamer doesn't hijack e.g. ``--help``.
# NOTE This naive fix does not support values like ``bar`` in
# ``--gst-foo bar``. Use equals to pass values, like ``--gst-foo=bar``.
gstreamer_args = [arg for arg in sys.argv[1:] if arg.startswith('--gst')]
mopidy_args = [arg for arg in sys.argv[1:] if not arg.startswith('--gst')]
def is_gst_arg(arg):
return arg.startswith('--gst') or arg == '--help-gst'
gstreamer_args = [arg for arg in sys.argv[1:] if is_gst_arg(arg)]
mopidy_args = [arg for arg in sys.argv[1:] if not is_gst_arg(arg)]
sys.argv[1:] = gstreamer_args
from pykka.registry import ActorRegistry

View File

@ -17,3 +17,10 @@ class HelpTest(unittest.TestCase):
self.assert_('--verbose' in output)
self.assert_('--save-debug-log' in output)
self.assert_('--list-settings' in output)
def test_help_gst_has_gstreamer_options(self):
mopidy_dir = os.path.dirname(mopidy.__file__)
args = [sys.executable, mopidy_dir, '--help-gst']
process = subprocess.Popen(args, stdout=subprocess.PIPE)
output = process.communicate()[0]
self.assert_('--gst-version' in output)