def comet_do_work_handler(obj_response, sleep_time):
    import time

    for i in range(6):
        width = '%spx' % (i * 80)
        obj_response.css('#progress', 'width', width)
        obj_response.html('#progress', width)

        # Yielding tells Sijax to flush the data to the browser.
        # This only works for Streaming functions (Comet or Upload)
        # and would not work for normal Sijax functions
        yield obj_response

        if i != 5:
            time.sleep(sleep_time)
dataset/ETHPy150Open spantaleev/flask-sijax/examples/comet.py/comet_do_work_handler/original