def generate_files(self, views): for view in views: view.write_start() for package in self.channel.packages: for view in views: view.write_package(package) for view in views: view.write_end() view.fileobj.close()