Example #1
0
 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
Example #2
0
 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
Example #3
0
def eventonly(callee):
    return takes_one_arg(callee, argname='event')
Example #4
0
 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)
Example #5
0
def requestonly(view, attr=None):
    return takes_one_arg(view, attr=attr, argname='request')
Example #6
0
def requestonly(view, attr=None):
    return takes_one_arg(view, attr=attr, argname='request')
Example #7
0
def eventonly(callee):
    return takes_one_arg(callee, argname='event')
Example #8
0
 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)