NEW: Better time stamp along with the filename to be used by other classes
This commit is contained in:
parent
f2606b31e5
commit
bd8b72c84f
|
@ -1,8 +0,0 @@
|
|||
#
|
||||
#
|
||||
#
|
||||
|
||||
class FingerprintWrite(Exception):
|
||||
"""Problem writing the fingerprint to a file"""
|
||||
pass
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
#
|
||||
#
|
||||
import re
|
||||
import time
|
||||
|
||||
#
|
||||
class ToolBox:
|
||||
|
@ -22,7 +23,7 @@ class ToolBox:
|
|||
cols = table.split(':')
|
||||
tblCols[cols[0]] = cols[1].split(',')
|
||||
return tblCols
|
||||
|
||||
|
||||
#
|
||||
@staticmethod
|
||||
def parseFilename(fqfilepath):
|
||||
|
@ -38,3 +39,12 @@ class ToolBox:
|
|||
if len(results.group(1)) != 0:
|
||||
filename = results.group(1)
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue