fmartingr
/
shelfzilla
Archived
1
0
Fork 0
This repository has been archived on 2021-06-29. You can view files and clone it, but cannot push or open issues or pull requests.
shelfzilla/shelfzilla/utils.py

14 lines
375 B
Python

import os
def filer_generate_randomized(instance, filename):
import uuid
print(instance)
uuid_str = str(uuid.uuid4())
random_path = u"%s/%s/%s" % (uuid_str[0:2], uuid_str[2:4], uuid_str)
name, extension = os.path.splitext(filename)
filename = u'{}{}'.format(
str(uuid.uuid4()), extension
)
return os.path.join(random_path, filename)