def next_job_hash(size=8):
"""
Generates a job hash (default: 8 characters).
:param size The amount of random characters to use for a job hash.
Defaults to 8.
:return Returns a job hash consisting of a static prefix, a timestamp
representing the time when the method was invoked, and random characters.
"""
job_hash = 'peekaboo-run_analysis-'
job_hash += '%s-' % datetime.now().strftime('%Y%m%dT%H%M%S')
job_hash += ''.join(
choice(string.digits + string.ascii_lowercase + string.ascii_uppercase)
for _ in range(size)
)
return job_hash
评论列表
文章目录