parameters: (self, extract_to)
docstring: Extracts all resources from our input file to a directory hierarchy
      in the directory named extract_to.
  
      The generated directory hierarchy is three-level, and looks like:
        resource-type/
          resource-name/
            lang-id.
  
      Args:
        extract_to: path to the folder to output to. This folder will be erased
            and recreated if it already exists.
docstring_summary: Extracts all resources from our input file to a directory hierarchy
      in the directory named extract_to.
docstring_tokens: Extracts all resources from our input file to a directory hierarchy in the directory named extract_to .
function: def ExtractAllToDir(self, extract_to):
      """Extracts all resources from our input file to a directory hierarchy
      in the directory named extract_to.
  
      The generated directory hierarchy is three-level, and looks like:
        resource-type/
          resource-name/
            lang-id.
  
      Args:
        extract_to: path to the folder to output to. This folder will be erased
            and recreated if it already exists.
      """
      _LOGGER.info('Extracting all resources from "%s" to directory "%s".',
          self.input_file, extract_to)
  
      if os.path.exists(extract_to):
        _LOGGER.info('Destination directory "%s" exists, deleting', extract_to)
        shutil.rmtree(extract_to)
  
      # Make sure the destination dir exists.
      os.makedirs(extract_to)
  
      # Now enumerate the resource types.
      for res_type in win32api.EnumResourceTypes(self.module):
        res_type_str = _ResIdToString(res_type)
  
        # And the resource names.
        for res_name in win32api.EnumResourceNames(self.module, res_type):
          res_name_str = _ResIdToString(res_name)
  
          # Then the languages.
          for res_lang in win32api.EnumResourceLanguages(self.module,
              res_type, res_name):
            res_lang_str = _ResIdToString(res_lang)
  
            dest_dir = os.path.join(extract_to, res_type_str, res_lang_str)
            dest_file = os.path.join(dest_dir, res_name_str)
            _LOGGER.info('Extracting resource "%s", lang "%d" name "%s" '
                         'to file "%s".',
                         res_type_str, res_lang, res_name_str, dest_file)
  
            # Extract each resource to a file in the output dir.
            os.makedirs(dest_dir)
            self.ExtractResource(res_type, res_lang, res_name, dest_file)
function_tokens: def ExtractAllToDir ( self , extract_to ) : _LOGGER . info ( 'Extracting all resources from "%s" to directory "%s".' , self . input_file , extract_to ) if os . path . exists ( extract_to ) : _LOGGER . info ( 'Destination directory "%s" exists, deleting' , extract_to ) shutil . rmtree ( extract_to ) # Make sure the destination dir exists. os . makedirs ( extract_to ) # Now enumerate the resource types. for res_type in win32api . EnumResourceTypes ( self . module ) : res_type_str = _ResIdToString ( res_type ) # And the resource names. for res_name in win32api . EnumResourceNames ( self . module , res_type ) : res_name_str = _ResIdToString ( res_name ) # Then the languages. for res_lang in win32api . EnumResourceLanguages ( self . module , res_type , res_name ) : res_lang_str = _ResIdToString ( res_lang ) dest_dir = os . path . join ( extract_to , res_type_str , res_lang_str ) dest_file = os . path . join ( dest_dir , res_name_str ) _LOGGER . info ( 'Extracting resource "%s", lang "%d" name "%s" ' 'to file "%s".' , res_type_str , res_lang , res_name_str , dest_file ) # Extract each resource to a file in the output dir. os . makedirs ( dest_dir ) self . ExtractResource ( res_type , res_lang , res_name , dest_file )