예제 #1
0
def traverser(_context, for_, type, factory,
              provides=IPublishTraverse,
              permission=None):
    view(_context, [factory], type, '', [for_],
         permission=permission,
         allowed_interface=None, allowed_attributes=None,
         provides=provides)
예제 #2
0
def navigation(_context, module, classes, layer=IDefaultBrowserLayer):
    """Handler for the `INavigationDirective`."""
    if not inspect.ismodule(module):
        raise TypeError("module attribute must be a module: %s, %s" %
                        module, type(module))
    for navclassname in classes:
        navclass = getattr(module, navclassname)

        # These are used for the various ways we register a navigation
        # component.
        factory = [navclass]
        for_ = [navclass.usedfor]

        # Register the navigation as the traversal component.
        provides = IBrowserPublisher
        name = ''
        view(_context, factory, layer, name, for_,
                permission=PublicPermission, provides=provides,
                allowed_interface=[IBrowserPublisher])
예제 #3
0
def navigation(_context, module, classes, layer=IDefaultBrowserLayer):
    """Handler for the `INavigationDirective`."""
    if not inspect.ismodule(module):
        raise TypeError("module attribute must be a module: %s, %s" % module,
                        type(module))
    for navclassname in classes:
        navclass = getattr(module, navclassname)

        # These are used for the various ways we register a navigation
        # component.
        factory = [navclass]
        for_ = [navclass.usedfor]

        # Register the navigation as the traversal component.
        provides = IBrowserPublisher
        name = ''
        view(_context,
             factory,
             layer,
             name,
             for_,
             permission=PublicPermission,
             provides=provides,
             allowed_interface=[IBrowserPublisher])
예제 #4
0
 def _callFUT(self, *args, **kw):
     from zope.component.zcml import view
     return view(*args, **kw)
예제 #5
0
 def _callFUT(self, *args, **kw):
     from zope.component.zcml import view
     return view(*args, **kw)