def minify_files(self):
        """
        Takes all the files either in the main directory or the input directory
        and minifies them. If the files came from the input directory, moves
        them to the main directory.
        """
        if self.input_directory:
            files = self.enumerate_files(self.input_directory)
        else:
            files = self.enumerate_files(self.directory)

        # Strings are a special case: apply that special case.
        if isinstance(self.minifier, basestring):
            minifier = {'css': self.minifier, 'js': self.minifier}
        else:
            minifier = self.minifier

        # For each file, if its extension has a minifier associated with it,
        # apply it.
        for name in files:
            try:
                command = minifier[get_extension(name)]
                command = command.format(in_name=name,
                                         out_name=self.get_output_name(name))

                rc = subprocess.call(command, shell=True)

                if rc != 0:
                    raise MinifierError("Error occurred during minification.")

            except __HOLE__:
                # If there's no minifier command, don't touch it.
                continue

        return
dataset/ETHPy150Open Lukasa/collectr/collectr/models.py/StaticDir.minify_files