[pygtk] Application name is '-c'

Walter Leibbrandt walter at translate.org.za
Tue Oct 14 21:02:53 WST 2008


$ cat papywizard.sh

python -c "from papywizard.scripts.main import main; main()" $@
... and there's your "-c". If you had replaced papywizard.sh with 
#!/usr/bin/env python
from papywizard.scripts.main import main
... and `chmod +x papywizard.py`, you also would not have had that problem.

If you still really want a shell script, you can call papywizard.py from 

But I have seen Willie's method used a lot too.


Willie Walker wrote:
> Here's the hack we did in Orca to prevent this from happening:
> # We're going to force the name of the app to "orca" so pygtk
> # will end up showing us as "orca" to the AT-SPI.  If we don't
> # do this, the name can end up being "-c".  See bug 364452 at
> # http://bugzilla.gnome.org/show_bug.cgi?id=364452 for more
> # information.
> #
> import sys
> sys.argv[0] = "orca"
> Will
> On Oct 14, 2008, at 6:56 AM, Frédéric wrote:
>> Le 14/10/2008, "Walter Leibbrandt" <walter at translate.org.za> a écrit:
>>> This is just a hunch, but I'll bet that you don't get that behavior 
>>> when
>>> you run your program from the command-line? My first guess is that it
>>> has something to do with the way in which your program is launched (ie.
>>> the exact command executed).
>> Unfortunatly, I always have the problem, whatever the way I launch it.
>>> It would help to have a link to your sources, though.
>> Sure:
>>     http://trac.gbiloba.org/papywizard/browser/trunk
>> I'm wondering if the problem did not appear when I start using i18n...
>> Could it be related? My dialogs are made with glade-3 (they are all in
>> the papywizard/view dir).
>> -- 
>>    Frédéric
>> _______________________________________________
>> pygtk mailing list   pygtk at daa.com.au
>> http://www.daa.com.au/mailman/listinfo/pygtk
>> Read the PyGTK FAQ: http://faq.pygtk.org/

Walter Leibbrandt                  http://translate.org.za/blogs/walter
Software Developer                                  +27 12 460 1095 (w)

Recent blogs:
* Switching from Subversion to git
* The first official release of Spelt
* Auto-completion and auto-correction for Gtk+ widgets

More information about the pygtk mailing list