def call_commands_serially(commands, status_update_callback, logger, close_logger_on_success=True):
 logger.write('Executing commands.\n\n')
 for c in commands:
  for e in c:
   status_update_callback(('%s\n%s' % e))
   logger.write(('# %s command \n%s\n\n' % e))
   (stdout, stderr, return_value) = qiime_system_call(e[1])
   if (return_value != 0):
    msg = (((('\n\n*** ERROR RAISED DURING STEP: %s\n' % e[0]) + ('Command run was:\n %s\n' % e[1])) + ('Command returned exit status: %d\n' % return_value)) + ('Stdout:\n%s\nStderr\n%s\n' % (stdout, stderr)))
    logger.write(msg)
    logger.close()
    raise WorkflowError(msg)
   else:
    logger.write(('Stdout:\n%s\nStderr:\n%s\n' % (stdout, stderr)))
    if stdout:
     print stdout
    if stderr:
     sys.stderr.write(stderr)
 if close_logger_on_success:
  logger.close()

def call_commands_serially ( commands , status_update_callback , logger , close_logger_on_success = True ) : logger . write ( 'Executing commands.\n\n' ) for c in commands : for e in c : status_update_callback ( ( '%s\n%s' % e ) ) logger . write ( ( '# %s command \n%s\n\n' % e ) ) ( stdout , stderr , return_value ) = qiime_system_call ( e [ 1 ] ) if ( return_value != 0 ) : msg = ( ( ( ( '\n\n*** ERROR RAISED DURING STEP: %s\n' % e [ 0 ] ) + ( 'Command run was:\n %s\n' % e [ 1 ] ) ) + ( 'Command returned exit status: %d\n' % return_value ) ) + ( 'Stdout:\n%s\nStderr\n%s\n' % ( stdout , stderr ) ) ) logger . write ( msg ) logger . close ( ) raise WorkflowError ( msg ) else : logger . write ( ( 'Stdout:\n%s\nStderr:\n%s\n' % ( stdout , stderr ) ) ) if stdout : print stdout if stderr : sys . stderr . write ( stderr ) if close_logger_on_success : logger . close ( )
run list of commands .