Ejemplo n.º 1
0
 def __init__(self, server, port):
     self.user_name = raw_input('user name?')
     self.client = ReliableChatClient(self.user_name, (server, port))
     self.client.data_changed = self.new_data
     self.client.try_connect()
     print 'connected'
     while 1:
         self.user_message(raw_input('what?'))
Ejemplo n.º 2
0
class DebugRallyClient(object):
    def __init__(self, server, port):
        self.user_name = raw_input('user name?')
        self.client = ReliableChatClient(self.user_name, (server, port))
        self.client.data_changed = self.new_data
        self.client.try_connect()
        print 'connected'
        while 1:
            self.user_message(raw_input('what?'))

    def new_data(self, msgs, acks):
        pass
        #print 'we got some new data'

    def user_message(self, message):
        self.client.say_require_ack(Message(self.user_name, message, 0))
Ejemplo n.º 3
0
class DebugRallyClient(object):
  def __init__(self, server, port):
    self.user_name = raw_input('user name?')
    self.client = ReliableChatClient(self.user_name, (server, port))
    self.client.data_changed = self.new_data
    self.client.try_connect()
    print 'connected'
    while 1:
      self.user_message(raw_input('what?'))

  def new_data(self, msgs, acks):
    pass
    #print 'we got some new data'

  def user_message(self, message):
    self.client.say_require_ack(Message(self.user_name, message, 0))
Ejemplo n.º 4
0
 def __init__(self, server, port):
   self.user_name = raw_input('user name?')
   self.client = ReliableChatClient(self.user_name, (server, port))
   self.client.data_changed = self.new_data
   self.client.try_connect()
   print 'connected'
   while 1:
     self.user_message(raw_input('what?'))
Ejemplo n.º 5
0
 def __init__(self, server, port):
   self.user_name = raw_input('user name?')
   self.client = ReliableChatClient(self.user_name, (server, port))
   self.ui = RallyCursesUI()
   #bind methods:
   self.ui.user_message = self.user_message 
   self.client.data_changed = self.ui.render_chats
   self.client.new_content_message = self.ui.new_content_message
   #start-er-up:
   try:
     self.client.try_connect()
     notify.init('Rally')
     self.ui.start()
     self.ui.read_msgs()
   except KeyboardInterrupt:
     pass
   finally:
     self.ui.close()
Ejemplo n.º 6
0
Archivo: client.py Proyecto: rcoh/Rally
class RallyClient(object):
  def __init__(self, server, port):
    start_logger('client') 
    self.user_name = raw_input('user name?')
    self.client = ReliableChatClient(self.user_name, (server, port))
    self.ui = RallyCursesUI()
    #bind methods:
    self.ui.new_outgoing_message = self.new_outgoing_message 
    self.client.data_changed = self.ui.render_chats
    self.client.new_content_message = self.ui.new_content_message
    #start-er-up:
    try:
      self.client.start()
      self.ui.start()
    except KeyboardInterrupt:
      pass
    finally:
      self.ui.close()
      print 'closed'

  def new_outgoing_message(self, message):
    self.client.say_require_ack(Message(self.user_name, message, 0))
Ejemplo n.º 7
0
Archivo: ui.py Proyecto: allygale/Rally
class RallyClient(object):
    def __init__(self, server, port):
        self.user_name = raw_input("user name?")
        self.client = ReliableChatClient(self.user_name, (server, port))
        self.ui = RallyCursesUI()
        # bind methods:
        self.ui.user_message = self.user_message
        self.client.data_changed = self.ui.render_chats
        self.client.new_content_message = self.ui.new_content_message
        # start-er-up:
        try:
            self.client.try_connect()
            notify.init("Rally")
            self.ui.start()
            self.ui.read_msgs()
        except KeyboardInterrupt:
            pass
        finally:
            self.ui.close()

    def user_message(self, message):
        self.client.say_require_ack(Message(self.user_name, message, 0))