Beispiel #1
0
  def send_message(self, message=None):
    text = self.input_text.get_text()
    print "in send_message: %s" % (text)
    api.send_text_msg(text) #send over the network    

    #also show on the chat box
    buf = self.chattextview.get_buffer()
    eob = buf.get_end_iter()
    buf.insert(eob,"\n"+text)
Beispiel #2
0
def main():  
  if len(sys.argv) != 5: 
    print '<usage> name ip port videoport'
    sys.exit(1)
  
  instance.name = sys.argv[1]
  instance.local_ip = sys.argv[2]
  instance.listen_port = int(sys.argv[3])
  instance.video_port = int(sys.argv[3])
  
  config.parse()
  
  if instance.curr_master == instance.name:
    master.init_master()
  else:
    network.join_meeting()
  
  instance.initialized = True
  
  api.init_gui()
  print "### done init_gui() ###"
  api.init_video_module()
  
  instance.last_heartbeat_rcvd = time.time()
  instance.master_thread = master.MasterThread()
  
  print "### 1 ###"
  if instance.curr_video_port != 0:
    api.connect_to_video_server(instance.curr_video_name, instance.curr_video_ip, instance.curr_video_port)
  
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  network.ListeningThread(s)
  network.ConnectingThread()

  print "### 2 ###"
  print "### I am up ###" 
  while 1:
    try:
      command = raw_input(">>>")
      if len(command) == 0:
        continue
      commands = command.split(':')
      if commands[0] == 'q':
        instance.has_exited = True
        network.close_connections()
        sys.exit(0)
      elif commands[0] == 'text':
        api.send_text_msg(commands[1])
      elif commands[0] == 'video':
        api.send_video_req()
      else:
        print 'This command is not supported'
    except KeyboardInterrupt:
      sys.exit(1)
Beispiel #3
0
def button1_clicked(widget):
  print "hello"
  global input_text
  text = input_text.get_text()
  api.send_text_msg(text) #send over the network    
Beispiel #4
0
def send_message(message = None):
  global input_text
  text = input_text.get_text()
  api.send_text_msg(text) #send over the network