Initial import to Tizen
[profile/ivi/python-twisted.git] / doc / conch / examples / demo.tac
1 # Copyright (c) Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4 # You can run this .tac file directly with:
5 #    twistd -ny demo.tac
6
7 """Nearly pointless demonstration of the manhole interactive interpreter.
8
9 This does about the same thing as demo_manhole, but uses the tap
10 module's makeService method instead.  The only interesting difference
11 is that in this version, the telnet server also requires
12 authentication.
13
14 Note, you will have to create a file named \"passwd\" and populate it
15 with credentials (in the format of passwd(5)) to use this demo.
16 """
17
18 from twisted.application import service
19 application = service.Application("TAC Demo")
20
21 from twisted.conch import manhole_tap
22 manhole_tap.makeService({"telnetPort": "tcp:6023",
23                          "sshPort": "tcp:6022",
24                          "namespace": {"foo": "bar"},
25                          "passwd": "passwd"}).setServiceParent(application)