import nautilus
import random

class ExampleProvider(nautilus.MenuProvider):
    def __init__(self):
        pass
        
    def get_file_items(self, window, files):
        menuitems = []
        
        for i in range(0, 5):
            identifier = "Test::Item%s" % i
            
            if (random.randint(0, 1) == 1):
                menuitems.append(nautilus.MenuItem(identifier, identifier, ""))

        print [menuitem.get_property("label") for menuitem in menuitems]
        return menuitems
        
    def get_background_items(self, window, files):
        pass
