Skip to content

Commit efe8ad4

Browse files
put a timestamp in the print to window (#489)
1 parent e7989f2 commit efe8ad4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gui/mountPrimaryWindow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from shutil import which
2828
import ctypes
2929
import string
30+
import datetime
3031

3132
# Import QT libraries
3233
from PySide6.QtCore import Qt, QSettings
@@ -300,7 +301,10 @@ def runCommand(self, commandParts):
300301
return ('', '', -1, False)
301302

302303
def addOutputText(self, textString):
303-
self.textEdit_output.setText(f"{self.textEdit_output.toPlainText()}{textString}\n")
304+
timestamp = datetime.datetime.now()
305+
# format into year/month/day, hour/minute/second
306+
formattedTimestamp = timestamp.strftime("%Y-%m-%d %H:%M:%S")
307+
self.textEdit_output.setText(f"{self.textEdit_output.toPlainText()}{formattedTimestamp}: {textString}\n")
304308
self.textEdit_output.repaint()
305309
self.textEdit_output.moveCursor(QtGui.QTextCursor.End)
306310

0 commit comments

Comments
 (0)