2

I recently installed mpd-gnome which among other things adds a nautilus extension nautilus-mpd.py. This extension does not seem to be working so I decided to run nautilus from the command line to see if it threw up some kind of error regarding the extension. Unfortunately as soon as I attempted this nautilus forked to the background or something.

How can I see exactly why my extension isn't work?

2
  • Is there a file in your home folder called nautilus-debug-log.txt? Sep 2, 2010 at 2:37
  • On a standard install Nautilus is always running in the background (and will be restarted automaticly by gnome-session if you try to kill it). Because of that, the nautilus you start just tells the existing nautilus process to open a new window and then exits, returning you to the commandline.
    – JanC
    Sep 2, 2010 at 8:26

3 Answers 3

3

I recall I was able to run nautilus from a terminal when debugging extensions myself; if you kill and then immediately restart nautilus, you should have it running from the command line:

nautilus -q && nautilus ~/

I was able to confirm that this works on Lucid. Note that passing in some directory when launching nautilus is important, otherwise it will fork off in the background.

1
  • Using --browser instead of some directory probably works too.
    – JanC
    Sep 3, 2010 at 10:52
1

If you want nautilus to stop permanently, open up gconf-editor and set /desktop/gnome/session/required_components_list to windowmanager,panel (removing "filemanager"). Then log out and back in.

To restore previous behavior, change the gconf key back to windowmanager,panel,filemanager.

0

From my experience the best way to debug a Nautilus extension is using Python's logging module to log stuff to a file. So you could do something like this

from gi.repository import Nautilus, GObject
import logging

class MyExtension(GObject.GObject, Nautilus.MenuProvider):
    
        def __init__(self):
            logging.basicConfig(filename="/your/path/pyext.log",
                        filemode='a',
                        format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
                        datefmt='%H:%M:%S',
                        level=logging.DEBUG)

And then throw logging.info()s around in your code.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .