parameters: (self,
                          artifact_dir,
                          dir_filter=None,
                          file_filter=None)
docstring: Create the list of installer artifacts.
  
      Creates three lists:
        1. a list of directories that need to be generated by the installer
        2. a list of files that get installed into those directories
        3. a list of symbolic links that need to be created by the installer
      These lists are used later on when generating the section commands that are
      compiled into the final installer
  
      Args:
        artifact_dir: The directory containing the files to add to the NSIS
            installer script.  The NSIS installer will reproduce this directory
            structure.
  
        dir_filter: A filter function for directories.  This can be written as a
            list comprehension.  If dir_filter is not None, then it is called
            with |_dirs|, and |_dirs| is replaced with the filter's
            output.
  
        file_filter: A filter function for files.  This can be written as a
            list comprehension.  If file_filter is not None, then it is called
            with |_files|, and |_files| is replaced with the filter's
            output.
docstring_summary: Create the list of installer artifacts.
docstring_tokens: Create the list of installer artifacts .
function: def InitFromDirectory(self,
                          artifact_dir,
                          dir_filter=None,
                          file_filter=None):
      '''Create the list of installer artifacts.
  
      Creates three lists:
        1. a list of directories that need to be generated by the installer
        2. a list of files that get installed into those directories
        3. a list of symbolic links that need to be created by the installer
      These lists are used later on when generating the section commands that are
      compiled into the final installer
  
      Args:
        artifact_dir: The directory containing the files to add to the NSIS
            installer script.  The NSIS installer will reproduce this directory
            structure.
  
        dir_filter: A filter function for directories.  This can be written as a
            list comprehension.  If dir_filter is not None, then it is called
            with |_dirs|, and |_dirs| is replaced with the filter's
            output.
  
        file_filter: A filter function for files.  This can be written as a
            list comprehension.  If file_filter is not None, then it is called
            with |_files|, and |_files| is replaced with the filter's
            output.
      '''
      self._relative_install_root = artifact_dir
      self.Reset()
      for root, dirs, files in os.walk(artifact_dir):
        map(lambda dir: self._dirs.add(os.path.join(root, dir)), dirs)
        map(lambda file: self._files.add(os.path.join(root, file)), files)
      if dir_filter:
        self._dirs = set(dir_filter(self._dirs))
      if file_filter:
        self._files = set(file_filter(self._files))
  
      def ReadCygwinSymlink(path):
        if not os.path.isfile(path):
          return None
        header = open(path, 'rb').read(12)
        if header != '!<symlink>\xff\xfe':
          return None
        data = open(path, 'rb').read()[12:]
        return ''.join([ch for ch in data if ch != '\x00'])
  
      # Pick out cygwin symlinks.
      all_files = self._files
      self._files = set()
      for f in all_files:
        link = ReadCygwinSymlink(f)
        if link:
          self._symlinks[f] = link
        else:
          self._files.add(f)
function_tokens: def InitFromDirectory ( self , artifact_dir , dir_filter = None , file_filter = None ) : self . _relative_install_root = artifact_dir self . Reset ( ) for root , dirs , files in os . walk ( artifact_dir ) : map ( lambda dir : self . _dirs . add ( os . path . join ( root , dir ) ) , dirs ) map ( lambda file : self . _files . add ( os . path . join ( root , file ) ) , files ) if dir_filter : self . _dirs = set ( dir_filter ( self . _dirs ) ) if file_filter : self . _files = set ( file_filter ( self . _files ) ) def ReadCygwinSymlink ( path ) : if not os . path . isfile ( path ) : return None header = open ( path , 'rb' ) . read ( 12 ) if header != '!<symlink>\xff\xfe' : return None data = open ( path , 'rb' ) . read ( ) [ 12 : ] return '' . join ( [ ch for ch in data if ch != '\x00' ] ) # Pick out cygwin symlinks. all_files = self . _files self . _files = set ( ) for f in all_files : link = ReadCygwinSymlink ( f ) if link : self . _symlinks [ f ] = link else : self . _files . add ( f )