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 re
|
||||||
|
import time
|
||||||
|
|
||||||
#
|
#
|
||||||
class ToolBox:
|
class ToolBox:
|
||||||
|
@ -22,7 +23,7 @@ class ToolBox:
|
||||||
cols = table.split(':')
|
cols = table.split(':')
|
||||||
tblCols[cols[0]] = cols[1].split(',')
|
tblCols[cols[0]] = cols[1].split(',')
|
||||||
return tblCols
|
return tblCols
|
||||||
|
|
||||||
#
|
#
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parseFilename(fqfilepath):
|
def parseFilename(fqfilepath):
|
||||||
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue