parameters: (self, cmd, extra_linker_path=None, extra_env={})
return_statement: return subprocess.call(cmd, env=env)
docstring: Launch the given command, passed as a list. The first item in the
          command list is the program name, without a path and without a suffix.
          These are determined from the tooldir member and the BIN_SUFFIX value.
          An extra_linker_path may be passed to give an additional directory
          to add to the search paths for the dynamic linker.
          An extra_env dict may be passed to give additional environment
          variables to export when running the command.
docstring_summary: Launch the given command, passed as a list. The first item in the
          command list is the program name, without a path and without a suffix.
          These are determined from the tooldir member and the BIN_SUFFIX value.
          An extra_linker_path may be passed to give an additional directory
          to add to the search paths for the dynamic linker.
          An extra_env dict may be passed to give additional environment
          variables to export when running the command.
docstring_tokens: Launch the given command passed as a list . The first item in the command list is the program name without a path and without a suffix . These are determined from the tooldir member and the BIN_SUFFIX value . An extra_linker_path may be passed to give an additional directory to add to the search paths for the dynamic linker . An extra_env dict may be passed to give additional environment variables to export when running the command .
function: def launch(self, cmd, extra_linker_path=None, extra_env={}):
          '''
          Launch the given command, passed as a list. The first item in the
          command list is the program name, without a path and without a suffix.
          These are determined from the tooldir member and the BIN_SUFFIX value.
          An extra_linker_path may be passed to give an additional directory
          to add to the search paths for the dynamic linker.
          An extra_env dict may be passed to give additional environment
          variables to export when running the command.
          '''
          assert self.tooldir
          cmd[0] = os.path.join(self.tooldir, 'bin',
                                cmd[0] + buildconfig.substs['BIN_SUFFIX'])
          if not extra_linker_path:
              extra_linker_path = os.path.join(self.tooldir, 'bin')
          env = dict(os.environ)
          for p in ['LD_LIBRARY_PATH', 'DYLD_LIBRARY_PATH']:
              if p in env:
                  env[p] = extra_linker_path + ':' + env[p]
              else:
                  env[p] = extra_linker_path
          for e in extra_env:
              env[e] = extra_env[e]
  
          # Work around a bug in Python 2.7.2 and lower where unicode types in
          # environment variables aren't handled by subprocess.
          for k, v in env.items():
              if isinstance(v, unicode):
                  env[k] = v.encode('utf-8')
  
          print >>errors.out, 'Executing', ' '.join(cmd)
          errors.out.flush()
          return subprocess.call(cmd, env=env)
function_tokens: def launch ( self , cmd , extra_linker_path = None , extra_env = { } ) : assert self . tooldir cmd [ 0 ] = os . path . join ( self . tooldir , 'bin' , cmd [ 0 ] + buildconfig . substs [ 'BIN_SUFFIX' ] ) if not extra_linker_path : extra_linker_path = os . path . join ( self . tooldir , 'bin' ) env = dict ( os . environ ) for p in [ 'LD_LIBRARY_PATH' , 'DYLD_LIBRARY_PATH' ] : if p in env : env [ p ] = extra_linker_path + ':' + env [ p ] else : env [ p ] = extra_linker_path for e in extra_env : env [ e ] = extra_env [ e ] # Work around a bug in Python 2.7.2 and lower where unicode types in # environment variables aren't handled by subprocess. for k , v in env . items ( ) : if isinstance ( v , unicode ) : env [ k ] = v . encode ( 'utf-8' ) print >> errors . out , 'Executing' , ' ' . join ( cmd ) errors . out . flush ( ) return subprocess . call ( cmd , env = env )