Example #1
0
class DeleteMenuItem(MenuItem):
    menu(IDocumentActions)
    title('Entfernen')
    name('delete')
    order(30)

    @property
    def available(self):
        return getattr(self.context, 'isDeletable', False)
Example #2
0
class EditMenuItem(MenuItem):
    menu(IDocumentActions)
    title(u'Bearbeiten')
    name('edit')
    order(20)

    @property
    def available(self):
        return getattr(self.context, 'isEditable', False)
class CommonArgs(Subscription):
    """Just an example of common args, not actually sure that -v is needed in every command."""
    implements(ICmdArgumentsSyntax)
    baseclass()
    order(-1)

    def arguments(self):
        parser = VirtualConsoleArgumentParser()
        parser.add_argument(
            '-v',
            '--verbose',
            action='count',
            help="be verbose, use it multiple times to increase verbosity")
        return parser
Example #4
0
class Two(object):
    grok.order(2)
Example #5
0
class One(object):
    grok.order()
Example #6
0
class SaturdayCleaner(grok.Subscription):
    grok.implements(ICleaner)
    grok.order(6)

    def work(self):
        print('Saturday cleaning!')
Example #7
0
class WednesdayCleaner(grok.Subscription):
    grok.implements(ICleaner)
    grok.order(3)

    def work(self):
        print('Wednesday cleaning!')
Example #8
0
class Cooking(DayTimeActivity):
    grok.order(10)

    def do(self):
        print '%s is cooking in %s!' % (self.who.name, self.where.name)
Example #9
0
class Six(object):
    grok.order()
Example #10
0
class Fourth(object):
    grok.order()
Example #11
0
class Third(object):
    grok.order()
Example #12
0
class Second(object):
    grok.order(1)
Example #13
0
class First(object):
    grok.order(2)
Example #14
0
class Gardening(DayTimeActivity):
    grok.order(15)

    def do(self):
        print '%s is growing pumpkins in %s!' % (self.who.name,
                                                 self.where.name)
Example #15
0
class DisplayMenuItem(MenuItem):
    menu(IContextualActionsMenu)
    title(u'Anzeigen')
    name('index')
    order(10)
Example #16
0
class Fifth(object):
    grok.order(1)
Example #17
0
class MondayCleaner(grok.Subscription):
    grok.implements(ICleaner)
    grok.order(1)

    def work(self):
        print('Monday cleaning!')
Example #18
0
class Four(object):
    grok.order(1)
Example #19
0
class Cleaning(DayTimeActivity):
    grok.order(99)

    def do(self):
        print '%s is cleaning the %s.' % (self.who.name, self.where.name)