Example #1
0
    def locateConfigurable(self, context, name):
        if name == '':
            return getSearchForm(context)
        elif name.startswith('move_'):
            dn = name[len('move_'):]

            session = context.locate(inevow.ISession)
            move = session.getComponent(IMove)
            if move is not None:
                for entry in move:
                    if entry.dn == dn:
                        return iformless.IConfigurable(MoveItem(entry))

        raise KeyError, name
Example #2
0
    def locateConfigurable(self, ctx, name):
        try:
            return super(ServicePasswordChangeMixin,
                         self).locateConfigurable(ctx, name)
        except AttributeError:
            if name.startswith('service_'):
                pass
            else:
                raise

        rest = name[len('service_'):]
        l = rest.split('_', 1)
        if len(l) != 2:
            raise AttributeError, name

        c = self.getServicePasswordAction(l[0])
        if c is None:
            raise AttributeError, name
        return iformless.IConfigurable(c(l[1]))
Example #3
0
 def locateConfigurable(self, *args, **kw):
     r = iformless.IConfigurable(self.conf)
     if not self.synchronousLocateConfigurable:
         r = util.succeed(r)
     return r
Example #4
0
 def findTheChoices(ctx, data):
     return getattr(
         iformless.IConfigurable(ctx).original,
         self.choicesAttribute)