def evolve(self, commit=True): steps = self.get_unfinished_steps() complete = [] for name, func in steps: self.transaction.begin() self.out('Executing evolution step %s' % name) if takes_one_arg(func): # BBB msg = ('Single argument evolution function ' 'steps now take two arguments: ' 'root and registry') warnings.warn(msg, DeprecationWarning, 2) func(self.context) else: func(self.context, self.registry) self.add_finished_step(name) t = self.transaction.get() if commit: t.note('Executed evolution step %s' % name) t.commit() else: t.abort() complete.append(name) return complete
def eventonly(callee): return takes_one_arg(callee, argname='event')
def _callFUT(self, view, attr=None, argname=None): from pyramid.config.util import takes_one_arg return takes_one_arg(view, attr=attr, argname=argname)
def requestonly(view, attr=None): return takes_one_arg(view, attr=attr, argname='request')