2023-08-31 15:21:43 +02:00
|
|
|
# standard imports
|
|
|
|
import uuid
|
|
|
|
import logging
|
|
|
|
|
|
|
|
logg = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
2023-09-01 04:53:23 +02:00
|
|
|
def do_yield(req, env, data_dir, settings):
|
2023-08-31 15:21:43 +02:00
|
|
|
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
|