Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(15)  |  Call(12)  |  Derive(0)  |  Import(3)

src/s/c/sc.contentrules.layout-1.0.1/src/sc/contentrules/layout/actions/layout.py   sc.contentrules.layout(Download)
from plone.contentrules.rule.interfaces import IRuleElementData
from Products.statusmessages.interfaces import IStatusMessage
from sc.contentrules.layout import MessageFactory as _
from sc.contentrules.layout.interfaces import ISetLayoutAction
from zope.component import adapts
    def summary(self):
        return _(u"Set layout ${layout} to a content item",
        if not (layout in available_layouts):
            self.error(obj, _(u"Layout ${layout} is not available for "
                       mapping={'layout': layout,
    form_fields = form.FormFields(ISetLayoutAction)
    label = _(u"Add set layout content rules action")
    description = _(u"An action to set the layout for content items")
    form_name = _(u"Configure action")

src/s/c/sc.contentrules.layout-1.0.1/src/sc/contentrules/layout/interfaces.py   sc.contentrules.layout(Download)
# -*- coding: utf-8 -*-
from sc.contentrules.layout import MessageFactory as _
from zope.interface import Interface
from zope.schema import Choice
class ISetLayoutAction(Interface):
    """ Configuration available for this content rule
    layout = Choice(title=_(u"Layout"),
                    description=_(u"Select the layout to be applied to the "

src/s/c/sc.contentrules.layout-1.0.1/src/sc/contentrules/layout/vocabulary.py   sc.contentrules.layout(Download)
from plone.contentrules.rule.interfaces import IRule
from Products.CMFCore.utils import getToolByName
from sc.contentrules.layout import MessageFactory as _
from zope.browsermenu.interfaces import IBrowserMenu
from zope.component import getUtility
    def __call__(self, context):
        self.context = context
        self.REQUEST = context.REQUEST
        terms = [SimpleTerm('_default_view',
                            title=_('Default Content View'))]
        return SimpleVocabulary(terms)