def write_report(self, session, filename):
        """
        Writes the report in JSON format to the given file
        """
        if not self.__report:
            session.write_line("No report to write down")
            return

        try:
            with open(filename, "w+") as out_file:
                out_file.write(self.to_json(self.__report))
        except IOError as ex:
            session.write_line("Error writing to file: {0}", ex)
def write_report ( self , session , filename ) : if not self . __report : session . write_line ( "No report to write down" ) return try : with open ( filename , "w+" ) as out_file : out_file . write ( self . to_json ( self . __report ) ) except IOError as ex : session . write_line ( "Error writing to file: {0}" , ex )
Writes the report in JSON format to the given file