예제 #1
0
 def factory(self, menu, title=None, order=0, icon=None, group=''):
     martian.validateInterfaceOrClass(self, menu)
     if not (issubclass(menu, IMenu) or IMenu.implementedBy(menu)):
         raise martian.error.GrokImportError(
             "You can only pass a class implementing "
             "megrok.navigation.interfaces.IMenu "
             "to the '%s' directive." % self.name)
     return menu, (title, order, icon, group)
예제 #2
0
 def factory(self, menu, locator, title=None, order=0, icon=None, group=''):
     martian.validateInterfaceOrClass(self, menu)
     martian.validateInterfaceOrClass(self, locator)
     if not (issubclass(locator, IContainerLocator) or ILocatorContainer.implementedBy(locator)):
         raise martian.error.GrokImportError(
             "You can only pass a class implementing "
             "raptus.mailcone.core.interfaces.IContainerLocator "
             "to the '%s' directive." % self.name)
     if not (issubclass(menu, IMenu) or IMenu.implementedBy(menu)):
         raise martian.error.GrokImportError(
             "You can only pass a class implementing "
             "megrok.navigation.interfaces.IMenu "
             "to the '%s' directive." % self.name)
     return menu, (locator, title, order, icon, group)