Fixed error with large logs

Due to change in file.seek() behavior, the log
viewer errorer when faced with a very large file.
This commit is contained in:
Marta Marczykowska-Górecka 2018-06-20 23:08:22 +02:00
parent 6b206d2050
commit 4933c6b580
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B

View File

@ -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()