~ntt-pf-lab/nova/monkey_patch_notification

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/core/howto/tutorial/listings/finger/organized-finger.tac

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# organized-finger.tac
 
2
# eg:  twistd -ny organized-finger.tac
 
3
 
 
4
import finger
 
5
 
 
6
from twisted.internet import protocol, reactor, defer
 
7
from twisted.spread import pb
 
8
from twisted.web import resource, server
 
9
from twisted.application import internet, service, strports
 
10
from twisted.python import log
 
11
 
 
12
application = service.Application('finger', uid=1, gid=1)
 
13
f = finger.FingerService('/etc/users')
 
14
serviceCollection = service.IServiceCollection(application)
 
15
internet.TCPServer(79, finger.IFingerFactory(f)
 
16
                   ).setServiceParent(serviceCollection)
 
17
 
 
18
site = server.Site(resource.IResource(f))
 
19
internet.TCPServer(8000, site
 
20
                   ).setServiceParent(serviceCollection)
 
21
 
 
22
internet.SSLServer(443, site, finger.ServerContextFactory()
 
23
                   ).setServiceParent(serviceCollection)
 
24
 
 
25
i = finger.IIRCClientFactory(f)
 
26
i.nickname = 'fingerbot'
 
27
internet.TCPClient('irc.freenode.org', 6667, i
 
28
                   ).setServiceParent(serviceCollection)
 
29
 
 
30
internet.TCPServer(8889, pb.PBServerFactory(finger.IPerspectiveFinger(f))
 
31
                   ).setServiceParent(serviceCollection)