Beispiel #1
0
 def on_load(self):
     """
     load the last few lines of the file.log
     This method is suppose to be called on switch-tab event (main_gui)
     """
     try:
         with open(cons.LOG_FILE, "rb") as fh:
             last_lines = tail(fh) #misc function
     except EnvironmentError as err:
         last_lines = str(err)
         logger.warning("{0}".format(err))
     
     self.text_view.setPlainText(smart_decode(last_lines))
Beispiel #2
0
    def on_load(self):
        """
        load the last few lines of the file.log
        This method is suppose to be called on switch-tab event (main_gui)
        """
        try:
            with open(cons.LOG_FILE, "rb") as fh:
                last_lines = tail(fh)  #misc function
        except EnvironmentError as err:
            last_lines = str(err)
            logger.warning("{0}".format(err))

        self.text_view.setPlainText(smart_decode(last_lines))
Beispiel #3
0
 def on_load(self):
     """
     load the last few lines of the file.log
     This method is suppose to be called on switch-tab event (main_gui)
     """
     try:
         with open(cons.LOG_FILE, "rb", cons.FILE_BUFSIZE) as fh:
             last_lines = tail(fh) #misc function
     except EnvironmentError as err:
         last_lines = str(err)
         logger.warning("{0}".format(err))
     
     buffer = self.text_field.get_buffer()
     buffer.set_text(smartdecode(last_lines))
Beispiel #4
0
    def on_load(self):
        """
        load the last few lines of the file.log
        This method is suppose to be called on switch-tab event (main_gui)
        """
        try:
            with open(cons.LOG_FILE, "rb", cons.FILE_BUFSIZE) as fh:
                last_lines = tail(fh)  #misc function
        except EnvironmentError as err:
            last_lines = str(err)
            logger.warning("{0}".format(err))

        buffer = self.text_field.get_buffer()
        buffer.set_text(smartdecode(last_lines))