From 6c4ec7e0c2a2f5459d092dcd6683150e08ae77c4 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Wed, 3 Apr 2013 00:10:23 +0200 Subject: [PATCH] main: Remove support for --gst-* and --help-gst Use GStreamer's environment variables instead, e.g. GST_DEBUG=3. --- mopidy/__main__.py | 20 ++++---------------- tests/help_test.py | 8 -------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/mopidy/__main__.py b/mopidy/__main__.py index 3c312ba0..f6b3127b 100644 --- a/mopidy/__main__.py +++ b/mopidy/__main__.py @@ -16,18 +16,10 @@ import pkg_resources import pykka.debug -# Extract any non-GStreamer arguments, and leave the GStreamer arguments for -# processing by GStreamer. This needs to be done before GStreamer is imported, -# 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``. - -def is_gst_arg(argument): - return argument.startswith('--gst') or argument == '--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 +# Extract any command line arguments. This needs to be done before GStreamer is +# imported, so that GStreamer doesn't hijack e.g. ``--help``. +mopidy_args = sys.argv[1:] +sys.argv[1:] = [] from mopidy import exceptions, settings @@ -101,10 +93,6 @@ def parse_options(): # NOTE First argument to add_option must be bytestrings on Python < 2.6.2 # See https://github.com/mopidy/mopidy/issues/302 for details - parser.add_option( - b'--help-gst', - action='store_true', dest='help_gst', - help='show GStreamer help options') parser.add_option( b'-i', '--interactive', action='store_true', dest='interactive', diff --git a/tests/help_test.py b/tests/help_test.py index 15c51d2a..4a852804 100644 --- a/tests/help_test.py +++ b/tests/help_test.py @@ -17,7 +17,6 @@ class HelpTest(unittest.TestCase): output = process.communicate()[0] self.assertIn('--version', output) self.assertIn('--help', output) - self.assertIn('--help-gst', output) self.assertIn('--interactive', output) self.assertIn('--quiet', output) self.assertIn('--verbose', output) @@ -25,10 +24,3 @@ class HelpTest(unittest.TestCase): self.assertIn('--show-config', output) self.assertIn('--config', output) self.assertIn('--option', 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.assertIn('--gst-version', output)