Changeset 35:2866eaae775f in ralphm-patches for client_service_example.patch
- Timestamp:
- Feb 12, 2010, 12:01:52 PM (11 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client_service_example.patch
r34 r35 1 diff -r a0bcf2e586ecdoc/examples/client_service.tac1 diff -r 0a3d1655a3e5 doc/examples/client_service.tac 2 2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3 +++ b/doc/examples/client_service.tac Fri Feb 12 09:50:08 2010 +01004 @@ -0,0 +1,4 0@@3 +++ b/doc/examples/client_service.tac Fri Feb 12 11:55:08 2010 +0100 4 @@ -0,0 +1,41 @@ 5 5 +from twisted.application import service 6 6 +from twisted.internet import defer … … 8 8 +from wokkel.client import ClientService 9 9 +from wokkel.generic import FallbackHandler 10 +from wokkel.xmppim import Roster Protocol10 +from wokkel.xmppim import RosterServerProtocol 11 11 + 12 12 +import socket 13 13 +domain = socket.gethostname() 14 14 + 15 +class StaticRoster(Roster Protocol):15 +class StaticRoster(RosterServerProtocol): 16 16 + 17 17 + def __init__(self): 18 + RosterServerProtocol.__init__(self) 18 19 + self.roster = {'ralphm': 19 20 + [{'jid': 'intosi@' + domain, … … 40 41 +clientService = ClientService(domain, 5224) 41 42 +clientService.logTraffic = True 42 + clientService.addHandler(FallbackHandler())43 + clientService.addHandler(StaticRoster())43 +FallbackHandler().setHandlerParent(clientService) 44 +StaticRoster().setHandlerParent(clientService) 44 45 +clientService.setServiceParent(application)
Note: See TracChangeset
for help on using the changeset viewer.