Exemplo n.º 1
0
 def register(self, scanner, name, wrapped):
     view_group = scanner.config.registry.queryUtility(IViewGroup, name = self.group_name)
     if view_group is None:
         view_group = ViewGroup(self.group_name)
         scanner.config.registry.registerUtility(view_group, IViewGroup, name = self.group_name)
     va =  ViewAction(wrapped, self.action_name, **self.kwargs)
     view_group.add(va)
Exemplo n.º 2
0
 def _register_dummy_va(self):
     def _dummy_callable(*args, **kw):
         return "Hello world"
     view_group = ViewGroup('login_forms')
     self.config.registry.registerUtility(view_group, IViewGroup, name = 'login_forms')
     view_group.add(ViewAction(_dummy_callable, 'dummy'))