def set_sessid(data): sessid = int(data[0]) help_msg = data[1] glob.pss = data[2:] glob.sess_id = sessid inp_elem = dom.document.getElementById("inp") inp_elem.disabled = False name_bar = dom.document.getElementById("namebar") name_bar.style.color = "black" name_bar.removeChild(name_bar.lastChild) name_bar.appendChild(create_text("Python console")) dom.document.getElementById("helpcontents").innerHTML = help_msg exported_methods.refresh_empty(sessid, refresh_console)
def refresh_console(msg): inp_elem = dom.document.getElementById("inp") #inp_elem.disabled = False if msg[0] == "refresh": data = msg[1] if data: inp_elem.scrollIntoView() inp_elem.focus() exported_methods.refresh_empty(glob.sess_id, refresh_console) add_text(data, True) elif msg[0] == 'disconnected': inp_elem.disabled = True name_bar = dom.document.getElementById("namebar") name_bar.style.color = "red" text = name_bar.lastChild.nodeValue name_bar.removeChild(name_bar.lastChild) name_bar.appendChild(create_text(text + " [DEFUNCT]")) glob.console_running = False if glob.next_console: next = glob.next_console glob.next_console = "" load_console(next)