slow-executor.py (397B)
1 import os.path 2 import time 3 4 from wptserve.pipes import template 5 6 def main(request, response): 7 time.sleep(float(request.GET.first(b"delay"))) 8 response.headers.set(b"Content-Type", b"text/html") 9 response.headers.set(b"Cache-Control", b"no-store") 10 response.content = template( 11 request, 12 open(os.path.join(os.path.dirname(__file__), "executor.sub.html"), "rb").read())