Skip to content

Commit

Permalink
add timestamp to reconstruction output
Browse files Browse the repository at this point in the history
  • Loading branch information
Qbicz committed Jul 18, 2017
1 parent 11c3319 commit a0faa6a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions python/ui_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import jsonpickle
from copy import deepcopy
import functools
import time

from PyQt5 import QtCore, QtWidgets
from gui.multisecret_dynamic_gui import MultiSecretGui
Expand Down Expand Up @@ -57,8 +58,13 @@ def menu_save_output(self):
print(output)

filename = QtWidgets.QFileDialog.getSaveFileName()[0] # filename is first element of a tuple
with open(filename, 'w') as f:
f.write(output)
try:
with open(filename, 'w') as f:
timestamp = time.strftime("%Y/%m/%d %H:%M:%S_", time.localtime())
f.write(timestamp + '\n')
f.write(output)
except FileNotFoundError as e:
print('File not specified.', e) # user aborted choosing a file

def refresh_dynamic_widgets_secrets_users(self):

Expand Down

0 comments on commit a0faa6a

Please sign in to comment.