Пример #1
0
def check_quizz(name, quizz, context):
    subs = queryOrderedSubscriptions(quizz, IQuizzSecurity)
    for sub in subs:
        success = sub.check(name, quizz, context)
        if not success:
            return False
    return True
Пример #2
0
    def _parent_parsers(self):
        parser_confs = queryOrderedSubscriptions(self, ICmdArgumentsSyntax)
        if ICmdArgumentsSyntax.providedBy(self):
            parser_confs.append(self)

        parsers = []
        for conf in parser_confs:
            p = yield conf.arguments()
            parsers.append(p)
        defer.returnValue(parsers)
Пример #3
0
    def _parent_parsers(self):
        parser_confs = queryOrderedSubscriptions(self, ICmdArgumentsSyntax)
        if ICmdArgumentsSyntax.providedBy(self):
            parser_confs.append(self)

        parsers = []
        for conf in parser_confs:
            p = yield conf.arguments()
            parsers.append(p)
        defer.returnValue(parsers)
 def test_simple(self):
     arg_parsers = queryOrderedSubscriptions(self.cmd, ICmdArgumentsSyntax)
     eq_(len(arg_parsers), 1)
Пример #5
0
 def test_simple(self):
     arg_parsers = queryOrderedSubscriptions(self.cmd, ICmdArgumentsSyntax)
     eq_(len(arg_parsers), 1)