Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 7b973fb3c8298f606d9b435aff551ab6 > files > 2708

python2-twisted-19.2.1-1.1.mga7.armv7hl.rpm

# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

# You can run this .tac file directly with:
#    twistd -ny demo.tac

"""Nearly pointless demonstration of the manhole interactive interpreter.

This does about the same thing as demo_manhole, but uses the tap
module's makeService method instead.  The only interesting difference
is that in this version, the telnet server also requires
authentication.

Note, you will have to create a file named \"passwd\" and populate it
with credentials (in the format of passwd(5)) to use this demo.
"""

from twisted.application import service
application = service.Application("TAC Demo")

from twisted.conch import manhole_tap
manhole_tap.makeService({"telnetPort": "tcp:6023",
                         "sshPort": "tcp:6022",
                         "namespace": {"foo": "bar"},
                         "passwd": "passwd",
                         "sshKeyDir": "<USER DATA DIR>",
                         "sshKeyName": "server.key",
                         "sshKeySize": 4096}).setServiceParent(application)