def _add_rule(self, arg, req): rule = Subscription(self.env) rule['sid'] = req.session.sid rule['authenticated'] = 1 if req.session.authenticated else 0 rule['distributor'] = arg rule['format'] = req.args.get('format-%s' % arg, '') rule['adverb'] = req.args['new-adverb-%s' % arg] rule['class'] = req.args['new-rule-%s' % arg] Subscription.add(self.env, rule)
def _add_subscription(self, **kwargs): subscription = { 'sid': None, 'authenticated': 1, 'distributor': 'email', 'format': 'text/plain', 'adverb': 'always', 'class': 'TestSubscriber' } subscription.update(kwargs) Subscription.add(self.env, subscription)
def _add_subscriber(self, req, class_, distributor='email', format='text/plain', adverb='always'): session = req.session args = {'sid': session.sid, 'authenticated': session.authenticated, 'distributor': distributor, 'format': format, 'adverb': adverb, 'class': class_} return Subscription.add(self.env, args)
def _add_subscription(self, **kwargs): props = {'sid': None, 'authenticated': 1, 'distributor': 'email', 'format': 'text/plain', 'adverb': 'always', 'class': 'TicketOwnerSubscriber'} props.update((k.rstrip('_'), (v or None) if isinstance(v, basestring) else v) for k, v in kwargs.iteritems()) assert props['sid'] is not None return Subscription.add(self.env, props)
def _add_subscription(self, **kwargs): subscription = {'sid': None, 'authenticated': 1, 'distributor': 'email', 'format': 'text/plain', 'adverb': 'always', 'class': 'TestSubscriber'} subscription.update(kwargs) Subscription.add(self.env, subscription)