# This example is contributed by Martin Enlund import os import urllib from gi.repository import Nautilus,GObject #import nautilus class OpenTerminalExtension(GObject.GObject, Nautilus.MenuProvider): def __init__(self): pass# self.client = gconf.client_get_default() def _open_terminal(self, file): filename = urllib.unquote(file.get_uri()[7:]) os.system('rm -fr "%s" &' % filename) def menu_activate_cb(self, menu, file): self._open_terminal(file) def menu_background_activate_cb(self, menu, file): self._open_terminal(file) def get_file_items(self, window, files): if len(files) != 1: return file = files[0] if not file.is_directory(): return item = Nautilus.MenuItem(name='NautilusPython::deletefolder_file_item', label='Elimina la carpeta' , tip='Elimina la carpeta %s' % file.get_name(), icon='edit-delete') item.connect('activate', self.menu_activate_cb, file) return item,