NEW: Better time stamp along with the filename to be used by other classes

This commit is contained in:
JohnE 2015-11-03 18:02:12 -08:00
parent f2606b31e5
commit bd8b72c84f
2 changed files with 11 additions and 9 deletions

View File

@ -1,8 +0,0 @@
#
#
#
class FingerprintWrite(Exception):
"""Problem writing the fingerprint to a file"""
pass

View File

@ -2,6 +2,7 @@
# #
# #
import re import re
import time
# #
class ToolBox: class ToolBox:
@ -38,3 +39,12 @@ class ToolBox:
if len(results.group(1)) != 0: if len(results.group(1)) != 0:
filename = results.group(1) filename = results.group(1)
return filename return filename
#
@staticmethod
def getTimestampFilename(fqfilename):
""" return output file name """
timestr = time.strftime('%Y-%m-%d_%H%M%S', time.localtime(time.time()))
filename = ToolBox.parseFilename(fqfilename)
fileout = filename + "_" + timestr + '.json'
return fileout