[pygtk] popt question

Rubens Ramos rubens_ramos at yahoo.com
Wed Jun 16 11:27:52 WST 2004


Hi Alex,

 I guess the short answer to what you are trying to do is - it is
not possible, due to some constraints in how the popt wrappers were
written (please see the "technical yaddayadda" if you are interested).

 However, one workaround is to do it this way:

 ./myprog -i "file1,file2,file3" -f "format1,format2,format3"

 and then split the arguments after the parsing is done. Would that
work for you?

Hope this helps,
Rubens

***** Technical yaddayadda *****

 Currently there is no way to use the pygtk popt bindings in a 
loop like what you can do in C - the wrappers do that 
for you, so the only option is to use get_popt_args() after
gnome.init() OR gnome.popt_parse().

There is no parallel between that (the C loop method) and the Python 
interface.

 The misterious flags in the Python table are the POPT_ARGFLAG_*
constants defined in popt.h and explained in the man page.

 And the callback functionality for the popt tables (as described
in the popt manpage) is not available in pygtk, as it is also
used internally by the wrappers - by the way, as I can see it, this
is also the only way you would be able to implement this:

 ./myprog -i file1 -f format1 -i file2 -f format2 -o file3 -f format3

 in C.


=====

----
Rubens Ramos Fernandes Junior
rubens_ramos at yahoo.com
----




		
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail


More information about the pygtk mailing list