Re: [jokosher-devel] Debugging output function



John Green wrote:
On Mon, Sep 25, 2006 at 11:41:06AM -0400, Laszlo Pandy wrote:
Now that we have command line option support, I took the liberty of making -d and -g options, which sent the debug output (that currently all goes to stdout) to stdout or gst.debug() respectively. This will keep the terminal nice and clean unless someone asks for all the verbose info.

A side effect of grabbing the args before 'import gst' does is that I found
the command line args that gst offers, --gst-debug, --gst-debug-no-color etc
quite handy and rather nicer to use than setting environment variables. I
wonder if there's an easy way to still get access to them.

I explained this to Jono on IRC, but I suppose I should do it here too.
Right now we use python's optparse module to parse the args for us. We actually don't need to use this module at all because GObject has its own thing called GOption. This is used my Gtk, Gstreamer, etc to do their options. For some reason gtk doesn't show a message automatically when "--help" is in the args, but gstreamer does (maybe a bug in pygst?). That is why we have to parse the options before importing gst.

So the proper way to do this is to tell GOption about our desired command line options and then GOption will show gstreamer, gtk and Jokosher options all in the same --help message. The only problem is that python cannot access GOption unless you use pygobject 2.12. 2.12 is available in edgy but not anywhere else afaik.

So when everyone is running edgy (or equivalent non-debian based distro), I will rewrite the options code to use GOption, and we will be able to use all the gtk and gstreamer options alongside Jokosher options.

Laszlo



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]