Exemple #1
0
 def onDocumentStart(self, rootElement):
     XmlStream.onDocumentStart(self, rootElement)
     #logging.debug('onDocumentStart')
     #m = message.Message('msg')
     #m.set('from', 'me')
     #self.send_message(m)
     self.handler.client_connected(self)
Exemple #2
0
 def __init__(self):
     XmlStream.__init__(self)  # possibly unnecessary
     self._initializeStream()
     m = Movie('potter', 'Harry Potter', 123)
     m1 = Movie('anillos', 'Lord of the Rings', 512)
     m2 = Movie('wars', 'Star Wars', 463)
     movie_list = [m, m1, m2]
     for movie in movie_list:
         movies.append(movie)
 def __init__(self):
     XmlStream.__init__(self)    # possibly unnecessary
     self._initializeStream()
     m = Movie('potter', 'Harry Potter', 123)
     m1 = Movie('anillos', 'Lord of the Rings', 512)
     m2 = Movie('wars', 'Star Wars', 463)
     movie_list = [m,m1,m2]
     for movie in movie_list:
         movies.append(movie)
Exemple #4
0
 def onElement(self, element):
     XmlStream.onElement(self, element)
     #logging.debug('Received message %s', element.toXml())
     m = message.Message(message = element)
     #Pass to client handler
     try:
         self.handler.process_message(m, self)
     except Exception, err:
         logging.exception('Error processing incoming message: %s', err)
Exemple #5
0
 def connectionLost(self, reason):
     #logging.debug('connectionLost')
     XmlStream.connectionLost(self, reason)
     self.handler.client_disconnected(self)
Exemple #6
0
 def connectionMade(self):
     #logging.debug('connectionMade')
     XmlStream.connectionMade(self)
     #Send start stream
     XmlStream.send(self, '<?xml version="1.0" encoding="utf-8"?><root>')
Exemple #7
0
 def __init__(self, handler):
     self.handler = handler
     self.id = 0
     XmlStream.__init__(self)
Exemple #8
0
 def __init__(self):
     XmlStream.__init__(self)  # possibly unnecessary
     self._initializeStream()
Exemple #9
0
 def __init__(self):
     XmlStream.__init__(self)  # possibly unnecessary
     self._initializeStream()
     self.download_server = None
Exemple #10
0
 def onDocumentStart(self, rootElement):
     XmlStream.onDocumentStart(self, rootElement)
     self.streamStarted(rootElement)
     self.addObserver('/message[@xmlns="%s"]' % self.NAMESPACE, self.handle_message)
Exemple #11
0
 def onDocumentStart(self, rootElement):
     XmlStream.onDocumentStart(self, rootElement)
     XmlStream.send(self, '<?xml version="1.0" encoding="utf-8"?><root>')
     # logging.debug('Document start received')
     manager.client_connected(self)
Exemple #12
0
 def onElement(self, element):
     # logging.debug('Element received')
     XmlStream.onElement(self, element)
     m = message.Message(message=element)
     manager.process_message(m, self)
Exemple #13
0
 def __init__(self):
     XmlStream.__init__(self)
     self._initializeStream()
     self.download_server = None
Exemple #14
0
 def __init__(self):
     XmlStream.__init__(self)    # possibly unnecessary
     self._initializeStream()
Exemple #15
0
 def __init__(self):
     XmlStream.__init__(self)
     self.commands = (('^hello', self.on_hello),
                      ('^help', self.on_help),
                      ('^turn on', self.on_turn_on),
                      ('^turn off', self.on_turn_off))
Exemple #16
0
 def send_message(self, m):
     try:
         logging.debug('Sending %s', m.to_xml())
         XmlStream.send(self, m.to_xml())
     except Exception, err:
         logging.exception('Sending failed: %s', err)
Exemple #17
0
 def __init__(self):
     XmlStream.__init__(self)
     self._initializeStream()
     self.movie_list = []
Exemple #18
0
 def connectionLost(self, reason):
     XmlStream.connectionLost(self, reason)
     manager.client_disconnected(self)
Exemple #19
0
 def __init__(self, stream_xmlns='jabber:client', *args, **kwargs):
     XmlStream.__init__(self, *args, **kwargs)
     self.connectionMade()
     self.dataReceived('<stream xmlns="%s">' % (stream_xmlns,))
     self.resulted_element = None
Exemple #20
0
 def __init__(self, stream_xmlns='jabber:client', *args, **kwargs):
     XmlStream.__init__(self, *args, **kwargs)
     self.connectionMade()
     self.dataReceived('<stream xmlns="%s">' % (stream_xmlns,))
     self.resulted_element = None
Exemple #21
0
 def send_message(self, m):
     # logging.debug('Sending %s', m.to_xml())
     XmlStream.send(self, m.to_xml())
Exemple #22
0
 def __init__(self):
     XmlStream.__init__(self)
     self._initializeStream()
Exemple #23
0
 def connectionMade(self):
     # Send start stream
     XmlStream.connectionMade(self)