code: def close_files(self):
          
          for name in self:
              if getattr(self, '_%s_diskflag' % name):
                  file_ = getattr(self, '_%s_file' % name)
                  file_.close()
docs: Close all files with an activated disk flag.