Commit 6893de6e authored by jvoisin's avatar jvoisin

Add a prototype for the nautilus extension

parent 3bf82af2
#!/usr/bin/env python3
import gi
gi.require_version('Nautilus', '3.0')
from gi.repository import Nautilus, GObject
class ColumnExtension(GObject.GObject, Nautilus.MenuProvider):
def menu_activate_cb(self, menu, file):
print "menu_activate_cb", file
# TODO: clean metadata here
def get_background_items(self, window, file):
""" """
return None
def get_file_items(self, window, files):
if len(files) != 1: # we're not supporting multiple files for now
file = files[0]
item = Nautilus.MenuItem(
label="Remove metadata from %s" % file.get_name(),
tip="Remove metadata from %s" % file.get_name()
item.connect('activate', self.menu_activate_cb, file)
return [item]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment