Selaa lähdekoodia

Fixed error with large logs

Due to change in file.seek() behavior, the log
viewer errorer when faced with a very large file.
Marta Marczykowska-Górecka 6 vuotta sitten
vanhempi
commit
4933c6b580
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      qubesmanager/log_dialog.py

+ 1 - 1
qubesmanager/log_dialog.py

@@ -58,7 +58,7 @@ class LogDialog(ui_logdlg.Ui_LogDialog, QtGui.QDialog):
         if log.tell() > LOG_DISPLAY_SIZE:
             self.displayed_text = self.tr(
                 "(Showing only last %d bytes of file)\n") % LOG_DISPLAY_SIZE
-            log.seek(-LOG_DISPLAY_SIZE, os.SEEK_END)
+            log.seek(log.tell()-LOG_DISPLAY_SIZE, os.SEEK_SET)
         else:
             log.seek(0, os.SEEK_SET)
         self.displayed_text += log.read()