def _dojo_mini_extreme(self):
        """
        This method removes all js files and just leaves all layer dojo files and static files (like "png", "gif", "svg", "swf", ...)
        """
        # prepare the regexp of files not to be removed!
        # mixin the profile specific skip files
        skip_files = self.SKIP_FILES + self.skip_files
        my_re = re.compile('^(.*/)?(%s)$' % "|".join(skip_files))
        try:
            '''Copied from the build_mini.sh shell script'''
            if not os.path.exists(self.dojo_release_dir):
                raise CommandError('The dojo build failed! Check messages above!')
            else:
                for root, dirs, files in os.walk(self.dojo_release_dir):
                    for file in files:
                        # remove all html-files
                        my_file = os.path.abspath(os.path.join(root, file))
                        if not my_re.match(my_file):
                            os.remove(my_file)
                # now remove all empty directories
                for root, dirs, files in os.walk(self.dojo_release_dir):
                    for dir in dirs:
                        try:
                            # just empty directories will be removed!
                            os.removedirs(os.path.join(root, dir))
                        except OSError:
                            pass
        except Exception, e:
            print e
            sys.exit(1)
dataset/ETHPy150Open klipstein/dojango/dojango/management/commands/dojobuild.py/Command._dojo_mini_extreme/original