def execute_instructions(plan, index=None, verbose=False, _commands=None):
 if (_commands is None):
  _commands = commands
 if verbose:
  from .console import setup_verbose_handlers
  setup_verbose_handlers()
 log.debug('executing plan %s', plan)
 state = {'i': None, 'prefix': context.root_dir, 'index': index}
 for (instruction, arg) in plan:
  log.debug(' %s(%r)', instruction, arg)
  if ((state['i'] is not None) and (instruction in PROGRESS_COMMANDS)):
   state['i'] += 1
   getLogger('progress.update').info((Dist(arg).dist_name, (state['i'] - 1)))
  cmd = _commands[instruction]
  if callable(cmd):
   cmd(state, arg)
  if ((state['i'] is not None) and (instruction in PROGRESS_COMMANDS) and (state['maxval'] == state['i'])):
   state['i'] = None
   getLogger('progress.stop').info(None)

def execute_instructions ( plan , index = None , verbose = False , _commands = None ) : if ( _commands is None ) : _commands = commands if verbose : from . console import setup_verbose_handlers setup_verbose_handlers ( ) log . debug ( 'executing plan %s' , plan ) state = { 'i' : None , 'prefix' : context . root_dir , 'index' : index } for ( instruction , arg ) in plan : log . debug ( ' %s(%r)' , instruction , arg ) if ( ( state [ 'i' ] is not None ) and ( instruction in PROGRESS_COMMANDS ) ) : state [ 'i' ] += 1 getLogger ( 'progress.update' ) . info ( ( Dist ( arg ) . dist_name , ( state [ 'i' ] - 1 ) ) ) cmd = _commands [ instruction ] if callable ( cmd ) : cmd ( state , arg ) if ( ( state [ 'i' ] is not None ) and ( instruction in PROGRESS_COMMANDS ) and ( state [ 'maxval' ] == state [ 'i' ] ) ) : state [ 'i' ] = None getLogger ( 'progress.stop' ) . info ( None )
execute the instructions in the plan .