

def close(self):
    ' MetaFiling.json (not needed?) list of all files written out\n        _reports = dict((report.basename, report.json) for report in self.reports)\n        _reports["filing"] = {"renderedFiles": sorted(self.renderedFiles)}\n        if self.options.logFile:\n            _reports["filing"]["logFile"] = self.options.logFile\n        if self.reportZip:\n            self.reportZip.writestr("MetaFiling.json", json.dumps(_reports, sort_keys=True, indent=jsonIndent))\n        else:\n            try:\n                if self.options.reportsFolder:\n                    with open(os.path.join(self.options.reportsFolder, "MetaFiling.json"), mode=\'w\') as f:\n                        json.dump(_reports, f, sort_keys=True, indent=jsonIndent)\n            except AttributeError: # no reportsFolder attribute\n                pass\n        '
    if (self.options and self.options.logFile):
        if (self.reportZip and (self.reportZip.fp is not None)):
            _logFile = self.options.logFile
            _logFileExt = os.path.splitext(_logFile)[1]
            if (_logFileExt == '.xml'):
                _logStr = self.cntlr.logHandler.getXml(clearLogBuffer=False)
            elif (_logFileExt == '.json'):
                _logStr = self.cntlr.logHandler.getJson(clearLogBuffer=False)
            else:
                _logStr = self.cntlr.logHandler.getText(clearLogBuffer=False)
            self.reportZip.writestr(_logFile, _logStr)
    if self.reportZip:
        self.reportZip.close()
    self.__dict__.clear()

dataset/ETHPy150Open Arelle/Arelle/arelle/plugin/validate/EFM/__init__.py Filing.close/original