parameters: (self, args)
return_statement: return newlist
docstring: When a static library name is found, either extract its contents
          in a temporary directory or use the information found in the
          corresponding lib descriptor.
docstring_summary: When a static library name is found, either extract its contents
          in a temporary directory or use the information found in the
          corresponding lib descriptor.
docstring_tokens: When a static library name is found either extract its contents in a temporary directory or use the information found in the corresponding lib descriptor .
function: def _extract(self, args):
          '''When a static library name is found, either extract its contents
          in a temporary directory or use the information found in the
          corresponding lib descriptor.
          '''
          ar_extract = conf.AR_EXTRACT.split()
          newlist = []
  
          def lookup(base, f):
              for root, dirs, files in os.walk(base):
                  if f in files:
                      return os.path.join(root, f)
  
          for arg in args:
              if os.path.splitext(arg)[1] == conf.LIB_SUFFIX:
                  if os.path.exists(arg + conf.LIBS_DESC_SUFFIX):
                      newlist += self._extract(self._expand_desc(arg))
                      continue
                  elif os.path.exists(arg) and (len(ar_extract) or conf.AR == 'lib'):
                      tmp = tempfile.mkdtemp(dir=os.curdir)
                      self.tmp.append(tmp)
                      if conf.AR == 'lib':
                          out = subprocess.check_output([conf.AR, '-NOLOGO', '-LIST', arg])
                          files = out.splitlines()
                          # If lib -list returns a list full of dlls, it's an
                          # import lib.
                          if all(isDynamicLib(f) for f in files):
                              newlist += [arg]
                              continue
                          for f in files:
                              subprocess.call([conf.AR, '-NOLOGO', '-EXTRACT:%s' % f, os.path.abspath(arg)], cwd=tmp)
                      else:
                          subprocess.call(ar_extract + [os.path.abspath(arg)], cwd=tmp)
                      objs = []
                      basedir = os.path.dirname(arg)
                      for root, dirs, files in os.walk(tmp):
                          for f in files:
                              if isObject(f):
                                  # If the file extracted from the library also
                                  # exists in the directory containing the
                                  # library, or one of its subdirectories, use
                                  # that instead.
                                  maybe_obj = lookup(os.path.join(basedir, os.path.relpath(root, tmp)), f)
                                  if maybe_obj:
                                      objs.append(relativize(maybe_obj))
                                  else:
                                      objs.append(relativize(os.path.join(root, f)))
                      newlist += sorted(objs)
                      continue
              newlist += [arg]
          return newlist
function_tokens: def _extract ( self , args ) : ar_extract = conf . AR_EXTRACT . split ( ) newlist = [ ] def lookup ( base , f ) : for root , dirs , files in os . walk ( base ) : if f in files : return os . path . join ( root , f ) for arg in args : if os . path . splitext ( arg ) [ 1 ] == conf . LIB_SUFFIX : if os . path . exists ( arg + conf . LIBS_DESC_SUFFIX ) : newlist += self . _extract ( self . _expand_desc ( arg ) ) continue elif os . path . exists ( arg ) and ( len ( ar_extract ) or conf . AR == 'lib' ) : tmp = tempfile . mkdtemp ( dir = os . curdir ) self . tmp . append ( tmp ) if conf . AR == 'lib' : out = subprocess . check_output ( [ conf . AR , '-NOLOGO' , '-LIST' , arg ] ) files = out . splitlines ( ) # If lib -list returns a list full of dlls, it's an # import lib. if all ( isDynamicLib ( f ) for f in files ) : newlist += [ arg ] continue for f in files : subprocess . call ( [ conf . AR , '-NOLOGO' , '-EXTRACT:%s' % f , os . path . abspath ( arg ) ] , cwd = tmp ) else : subprocess . call ( ar_extract + [ os . path . abspath ( arg ) ] , cwd = tmp ) objs = [ ] basedir = os . path . dirname ( arg ) for root , dirs , files in os . walk ( tmp ) : for f in files : if isObject ( f ) : # If the file extracted from the library also # exists in the directory containing the # library, or one of its subdirectories, use # that instead. maybe_obj = lookup ( os . path . join ( basedir , os . path . relpath ( root , tmp ) ) , f ) if maybe_obj : objs . append ( relativize ( maybe_obj ) ) else : objs . append ( relativize ( os . path . join ( root , f ) ) ) newlist += sorted ( objs ) continue newlist += [ arg ] return newlist