gasgasgas/gas3/base.py
2023-09-01 03:53:23 +01:00

20 lines
332 B
Python

# standard imports
import uuid
import logging
logg = logging.getLogger(__name__)
def do_yield(req, env, data_dir, settings):
u = uuid.uuid4()
data_dir.add(u, b'\x00')
return str(u)
def check(s, data_dir):
p = data_dir.to_filepath(s)
f = open(p, 'rb')
r = f.read(20)
f.close()
return len(r) == 1