(self)
Get the content of the non understood queries file
Get the content of the non understood queries file
Get the content of the non understood queries file
def read_not_understood_file(self):
        """ Get the content of the non understood queries file
        """
        if os.path.isfile(STAR_FILE):
            self.log.info(u"Not understood queries file found : {0}".format(STAR_FILE))

            try:
                import codecs
                file = codecs.open(STAR_FILE, 'r', 'utf-8')
                file_content = file.read()
                file_header = "// File : {0}".format(STAR_FILE)
                self.not_understood_content = u"{0}\n\n{1}".format(file_header, file_content)
            except:
                self.not_understood_content = u"Error while reading file '{0}'. Error is : {1}".format(STAR_FILE, traceback.format_exc())
                self.log.error(self.not_understood_content)
        else:
            self.not_understood_content = u""
            self.log.info(u"Not understood queries file NOT found : {0}. This is not an error. Your butler is just awesome (or unused) ;)".format(STAR_FILE))
def read_not_understood_file ( self ) : if os . path . isfile ( STAR_FILE ) : self . log . info ( u"Not understood queries file found : {0}" . format ( STAR_FILE ) ) try : import codecs file = codecs . open ( STAR_FILE , 'r' , 'utf-8' ) file_content = file . read ( ) file_header = "// File : {0}" . format ( STAR_FILE ) self . not_understood_content = u"{0}\n\n{1}" . format ( file_header , file_content ) except : self . not_understood_content = u"Error while reading file '{0}'. Error is : {1}" . format ( STAR_FILE , traceback . format_exc ( ) ) self . log . error ( self . not_understood_content ) else : self . not_understood_content = u"" self . log . info ( u"Not understood queries file NOT found : {0}. This is not an error. Your butler is just awesome (or unused) ;)" . format ( STAR_FILE ) )