PageRenderTime 306ms CodeModel.GetById 303ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/libtest/write.py

http://pyjamas.googlecode.com/
Python | 16 lines | 15 code | 1 blank | 0 comment | 0 complexity | 93089979fb116211a825ba7a00011be7 MD5 | raw file
 1import DOM
 2
 3def getBodyElement():
 4    JS(""" return $doc.body; """)
 5
 6def write(text):
 7    global data, element
 8    data += text
 9    DOM.setInnerHTML(element, data)
10
11def writebr(text):
12    write(text + r"<BR>\n")
13
14data = ""
15element = DOM.createDiv()
16DOM.appendChild(getBodyElement(), element)