[gst-devel] gstrreamer and optparse

Nicolas Bertrand nico at inattendu.org
Tue Dec 8 07:44:44 CET 2009


Hello,
I facing some problems using gst and optparse under python . When I use
the -h option in my app , I have the help options of gstreamer not of my
app.
I use python 2.6 and python-gst 0.10.17-1 under ubuntu karmic

Do you have and idea of how I can display my options instead of
gstreamer one ?

Here after the sample code :

from optparse import OptionParser
from optparse import make_option
import gst

if __name__ == '__main__' :

    option_list = [

        make_option("-f", "--file",

                action="store", type="string", dest="filename",

                help=u'"Luciole project file (.xml) to load', metavar="FILE"),

        make_option("-v", "--verbose",

                action="store_true", dest="is_verbose", default=False,

                help=u'Toogle verbosity')]

    usage = "usage: %prog [options] "

    parser = OptionParser(option_list=option_list,usage=usage)

    (options, args2) = parser.parse_args()


The output is :

Usage:

  test_opt_gst.py [OPTION...] - GStreamer initialization

Help Options:

  -h, --help                        Show help options

  --help-all                        Show all help options

  --help-gst                        Show GStreamer Options


Thanks in advance
Cheers

Nico




More information about the gstreamer-devel mailing list