Ticket #1528: broken_pipe.py

File broken_pipe.py, 551 bytes (added by vrialland, 5 years ago)

Test case

Line 
1import time
2
3from nagare import ajax, component, presentation
4
5
6class Async(object):
7    def long_action(self, v):
8        time.sleep(2)
9
10
11@presentation.render_for(Async)
12def render(self, h, comp, model):
13    return h.input(onblur=ajax.Update(action=self.long_action))
14
15
16class Main(object):
17    def __init__(self):
18        self.comp = component.Component(Async())
19
20
21@presentation.render_for(Main)
22def render(self, h, comp, model):
23    with h.form:
24        h << self.comp.render(h.AsyncRenderer())
25        h << h.input(type='submit')
26    return h.root