Ejemplo n.º 1
0
 def send_text_msg(self):
     self.clear_screen()
     self.print_line("#")
     self.print_bold("Text Edit Mode")
     self.print_dotline()
     self.print_wrapmsg(
         "Instruction: Enter/Paste your content at bellow. Ctrl-D to send it."
     )
     self.print_dotline()
     contents = []
     while True:
         try:
             line = raw_input("")
         except EOFError:
             break
         contents.append(line)
     text = "\n".join(contents)
     self.print_dotline()
     self.print_line("=")
     print("server status...")
     txtmsg = TextMessage()
     txtmsg.set_text_body(text)
     self.server.send_message(txtmsg)
     self.print_line("#")
     self.pasue_screen()
Ejemplo n.º 2
0
 def handle(self):
     print 'Got connection from {}'.format(self.client_address)
     txtmsg = TextMessage()
     txtmsg.set_text_body("hello guest!")
     self.request.sendall(txtmsg.as_string())