Changeset 72:d48789c4c484 for wokkel/client.py
- Timestamp:
- Jul 21, 2009, 8:00:12 PM (13 years ago)
- Branch:
- default
- Convert:
- svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@190
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wokkel/client.py
r71 r72 80 80 81 81 82 82 83 class XMPPClient(StreamManager, service.Service): 83 84 """ … … 86 87 87 88 def __init__(self, jid, password, host=None, port=5222): 89 self.jid = jid 88 90 self.domain = jid.host 89 91 self.host = host … … 94 96 StreamManager.__init__(self, factory) 95 97 98 96 99 def startService(self): 97 100 service.Service.startService(self) 98 101 99 102 self._connection = self._getConnection() 103 100 104 101 105 def stopService(self): … … 104 108 self.factory.stopTrying() 105 109 self._connection.disconnect() 110 111 112 def _authd(self, xs): 113 """ 114 Called when the stream has been initialized. 115 116 Save the JID that we were assigned by the server, as the resource might 117 differ from the JID we asked for. This is stored on the authenticator 118 by its constituent initializers. 119 """ 120 self.jid = self.factory.authenticator.jid 121 StreamManager._authd(self, xs) 122 106 123 107 124 def initializationFailed(self, reason): … … 115 132 reason.raiseException() 116 133 134 117 135 def _getConnection(self): 118 136 if self.host: … … 122 140 c.connect() 123 141 return c 142 124 143 125 144
Note: See TracChangeset
for help on using the changeset viewer.