From: Douglas S. B. <db...@cs...> - 2008-11-28 19:00:16
|
> But speaking of GNOME, I have just tracked down a very weird behavior: I'm > working between gramps30 and trunk on Fedora10, and I find that old code > is run sometimes. For example: > > python trunk/src/gramps.py --help > > should show a -L option in trunk, but it seems to run the old > ArgHandler.py code. I tracked this down to the command in gramps.py: > > gnome.init_program(...) > > Any version of this line causes the old code to run rather than the new. > If I remove the line, then the new code runs. Anyone know how to force it > to ignore what is cached? I don't understand this at all, and see of no > mechanism to explain what I'm seeing... except to invoke gnome magic. Ok, I think I see what is going on: gnome.init_program(...) will automatically handle certain well-defined flags, like --help and --usage and it halts right there. If you call it like: program = gnome.program_init('gramps',const.VERSION) then you get a generic GNOME help message and it exits. If you call it like: program = gnome.program_init('gramps',const.VERSION, gnome.libgnome_module_info_get(), args, const.POPT_TABLE) then it is using a cached version of the GRAMPS options (from the first use maybe?) and it exits. The question is: how to you get gnome to clear its cached option values? -Doug |