Package pyjamas :: Module log
[hide private]
[frames] | no frames]

Source Code for Module pyjamas.log

 1  # Use this to output (cumulatively) text at the bottom of the HTML page 
 2   
 3  from pyjamas import DOM 
 4  from __pyjamas__ import doc 
 5   
6 -def getBodyElement():
7 return doc().body
8
9 -def write(text):
10 add_elem() 11 global data 12 text = text.replace("\n", "<br />\n") 13 data += text 14 DOM.setInnerHTML(element, data)
15
16 -def writebr(text):
17 write(text + "\n")
18 19 data = "" 20 element = None 21
22 -def add_elem():
23 global element 24 if element is not None: 25 return 26 element = DOM.createDiv() 27 DOM.appendChild(getBodyElement(), element)
28