#NEWLINE# def run_cmds( cmds , fail_sequential = False ) : #NEWLINE# #INDENT# ' Run a list of ([args], tries) tuples, aborting the run if a single one\n    fails and fail_sequential is set to True.\n    Returns True if all succeed, and False if any fail.\n    ' #NEWLINE# to_return = True #NEWLINE# for ( cmd , tries ) in cmds : #NEWLINE# #INDENT# if ( ( not to_return ) and fail_sequential ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if run_cmd ( cmd , attempts = tries ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# to_return = False #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return to_return