gcmd-devel
[Top][All Lists]
Advanced

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

Re: [gcmd-dev] Python plugins


From: Piotr Eljasiak
Subject: Re: [gcmd-dev] Python plugins
Date: Fri, 08 Dec 2006 23:54:41 +0100

> >>I just tried your sample-plugin, gcmd crashes
> >>immediately when i press F12, nothing at all
> >>gets written to console.
> >>
> >>Any advice on gathering debug info?
> > 
> > 
> > run in console with set debug flag to p:
> > 
> >         gnome-commander -d=p
> >         
> 
> Not much, but here it comes:
> 
> gnome-commander -d=p
> [PP] Calling sample-plugin.main()

excerpt from src/gnome-cmd-python-plugin.c:


        gboolean gnome_cmd_python_plugin_execute(const gchar *fname,
        GnomeCmdMainWin *mw)
        {
            gboolean retval = FALSE;
        
            DEBUG('p', "Calling %s.main()\n", fname);
        
            PyObject *pmod = PyImport_ImportModule("gnomevfs");
        
        Please insert here:
        
        TRACE(pmod,%p); // (A)
        
            PyObject *pURIclass = PyObject_GetAttrString(pmod, "URI");
        
        TRACE(pURIclass,%p); // (B)
        
            Py_XDECREF(pmod);
        
            if (!pURIclass)
                goto out_A;
        
            PyObject *pName = PyString_FromString(fname);
        
        TRACE(pName,%p); // (C)
        
            PyObject *pModule = PyImport_Import(pName);
            Py_XDECREF(pName);
        
            if (!pModule)
            {
                PyErr_Print();
                g_warning("Failed to load \"%s\"\n", fname);
        
                goto out_B;
            }
        
        
        You can pinpoint the place where gcmd crashes by inserting TRACE() 
macro and watching if it outputs to console or not... If it's not (A) place - 
try other ones
        
        BTW - I suspect that python "gnomevfs" module is not successfully 
loaded (pmod==NULL). Do you have it installed? You can check it by invoking 
python shell from console and then:
        
        >>> import gnomevfs
        
        (exit from python with CTRL+D)
        

        





reply via email to

[Prev in Thread] Current Thread [Next in Thread]