def do_pre_ops(cnxt, stack, current_stack=None, action=None):
 cinstances = get_plug_point_class_instances()
 if (action is None):
  action = stack.action
 (failure, failure_exception_message, success_count) = _do_ops(cinstances, 'do_pre_op', cnxt, stack, current_stack, action, None)
 if failure:
  cinstances = cinstances[0:success_count]
  _do_ops(cinstances, 'do_post_op', cnxt, stack, current_stack, action, True)
  raise Exception(failure_exception_message)

def do_pre_ops ( cnxt , stack , current_stack = None , action = None ) : cinstances = get_plug_point_class_instances ( ) if ( action is None ) : action = stack . action ( failure , failure_exception_message , success_count ) = _do_ops ( cinstances , 'do_pre_op' , cnxt , stack , current_stack , action , None ) if failure : cinstances = cinstances [ 0 : success_count ] _do_ops ( cinstances , 'do_post_op' , cnxt , stack , current_stack , action , True ) raise Exception ( failure_exception_message )
call available pre-op methods sequentially .