def handle_recv (self, data): import basics if data['type'] == "ping": src = getattr(cs176, data['src']) dst = getattr(cs176, data['dst']) src.send(basics.Ping(dst), flood=True) elif data['type'] == "console": # Execute python command, return output to GUI #print "Got command:", data['command'] r = interp.runsource(data['command'], "<gui>") if r: events.send_console_more(data['command'])
def _handle_ping(self, node1, node2): import basics node1 = core._getByName(node1).entity node2 = core._getByName(node2).entity if node1 and node2: node1.send(basics.Ping(node2), flood=True)