Currently you should do the argument parsing before importing gnome.applet
or whatever.  This is not ideal, and will probably be updated at some
point (probably with the upgrade to gnome-libs-2).  At some point in the
future, it will probably be necessary to call a gnome.init() function,
which may also provide support for adding your own popt argument parsing
table.

For now, it is probably best to do some of the argument parsing before
importing any of gnome.*.  You should probably remove the arguments you
use from sys.argv.

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


On Mon, 29 Nov 1999, [iso-8859-1] Erik B�gfors wrote:

> Hi all!
> 
> Two weeks ago I discovered python and that it was great for doing
> gnome/gtk-development.
> 
> I am currently writing a program that should be able to use a panel-applet
> if you want it to.  I would like to be able to use --noapplet or something
> simular to NOT run the applet.  
> 
> When the program gets to the "import gnome.applet"-line it parses the
> arguments given to the program and says Error on option --noapplet: unknown
> option.  So using getopt or just reading the argv doesn't work.
> 
> I know the gnome-stuff uses popt to parse the arguments but I cannot find
> any way to access them from within python.
> 
> Maybe I could do the parsing first and then import gnome.applet only after
> removing some arguments from argv but that is NOT a good way to solve the
> problems.
> 
> Anyone have any idea?
> 
> /Erik
> -- 
> Erik B�gfors               | http://www.acc.umu.se/~bagfors/
> Email: [EMAIL PROTECTED]  | Center for Parallel Computers
> GSM +46 70 398 54 43       | Supporter of free software
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
> 

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to