def extract(self, zip_archive, font_files):
        """
        Extract files to install
        """
        # Get a temp directory
        tmp_container = tempfile.mkdtemp(prefix='icomoon-tmp')
        self._debug("* Temporary dir for extracted archive: {}", tmp_container)

        # Extract manifest to temp directory
        zip_archive.extract(settings.ICOMOON_MANIFEST_FILENAME, tmp_container)
        # Then the font files
        for item in font_files:
            zip_archive.extract(item, tmp_container)

        # Get manifest for icon map
        webfont_store = WebfontStore(settings.ICOMOON_MANIFEST_FILENAME)
        webfont_store.get(self.webfont_name, {
            'fontdir_path': tmp_container,
        })
        icons = webfont_store.get_manifests()[self.webfont_name]
        #print json.dumps(icons, indent=4)

        # Render CSS icon part
        css_content = self.render_css(self.css_templatepath, icons)

        return tmp_container, css_content
def extract ( self , zip_archive , font_files ) : tmp_container = tempfile . mkdtemp ( prefix = 'icomoon-tmp' ) self . _debug ( "* Temporary dir for extracted archive: {}" , tmp_container ) zip_archive . extract ( settings . ICOMOON_MANIFEST_FILENAME , tmp_container ) for item in font_files : zip_archive . extract ( item , tmp_container ) webfont_store = WebfontStore ( settings . ICOMOON_MANIFEST_FILENAME ) webfont_store . get ( self . webfont_name , { 'fontdir_path' : tmp_container , } ) icons = webfont_store . get_manifests ( ) [ self . webfont_name ] css_content = self . render_css ( self . css_templatepath , icons ) return tmp_container , css_content
Extract files to install