def extract(self, filename):
        """
        Extracts the given file to a temporarily and returns
        the path of the directory with the extracted content.
        """
        prefix = 'django_%s_template_' % self.app_or_project
        tempdir = tempfile.mkdtemp(prefix=prefix, suffix='_extract')
        self.paths_to_remove.append(tempdir)
        if self.verbosity >= 2:
            self.stdout.write("Extracting %s\n" % filename)
        try:
            archive.extract(filename, tempdir)
            return tempdir
        except (archive.ArchiveException, IOError), e:
            raise CommandError("couldn't extract file %s to %s: %s" %
                               (filename, tempdir, e))
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/core/management/templates.py/TemplateCommand.extract/original