def backup(self):
        """Generate a backup file for each file."""

        for filename in self.filenames[:]:
            if not filename.endswith("."+self.PYTHON_EXTENSION):
                continue
            origfilename = filename + "." + self.BACKUP_EXTENSION
            if origfilename not in self.filenames:
                shutil.copy(filename, origfilename)
                self.filenames.append(origfilename)
Generate a backup file for each file.
recipes/Python/577788_Simple_Class_Transforming_PythSource/recipe-577788.py