Exemple #1
0
def get_wavecode(wid):
    """return the code from parameter wave's id"""
    from wirewave import WaveReader
    w = WaveReader()
    w.read(wid)
    code = w.get_root_text()
    logging.info(code)
    return code
Exemple #2
0
def viewwave(wid):
	print "rendering "+wid
	w = WaveReader()
	if not w.read(wid):
		print "Wave is not accessible, or not public"
		return
	w.render()
	(h,fn) = tempfile.mkstemp(".html","wave")
	os.write(h,w.renderedHTML.encode("UTF8"))
	os.close(h)
	webbrowser.open_new_tab(fn)
	pass
Exemple #3
0
def showcode(wid):
	w = WaveReader()
	if not w.read(wid):
		print "Wave is not accessible, or not public"
		return
	code = w.get_root_text()
	code = code.replace("\n","\r\n")
	print code
	(h,fn) = tempfile.mkstemp(".txt","wave")
	os.write(h,code.encode("UTF8"))
	os.close(h)
	os.startfile(fn)
	pass