Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add remote REPL

  • Loading branch information...
commit 2e413314c915ba5feebd5faff3eac6651016a469 1 parent 49138c9
@ubolonton ubolonton authored
Showing with 19 additions and 1 deletion.
  1. +19 −1 twisted/plugins/warp_plugin.py
View
20 twisted/plugins/warp_plugin.py
@@ -112,6 +112,7 @@ def makeService(self, options):
if hasattr(configModule, 'startup'):
configModule.startup()
+ # Start a console instead of the site
if options.subCommand == "console":
locals = {'store': runtime.store}
interpreter = options.subOptions.get("interpreter",
@@ -152,7 +153,24 @@ def makeService(self, options):
if hasattr(configModule, 'mungeService'):
service = configModule.mungeService(service)
- return service
+ # Start a remote console if console:port and
+ # console:passwd_file are specified
+ passwd = config.get("console", {}).get("passwd_file")
+ if passwd:
+ from twisted.conch import manhole_tap
+ from twisted.application.service import MultiService
+ manhole = manhole_tap.makeService({
+ "namespace": {"store": runtime.store},
+ "sshPort": "tcp:%s:interface=127.0.0.1" % config["console"]["sshPort"],
+ "telnetPort": "tcp:%s:interface=127.0.0.1" % config["console"]["telnetPort"],
+ "passwd": passwd,
+ })
+
+ ms = MultiService()
+ manhole.setServiceParent(ms)
+ service.setServiceParent(ms)
+ return ms
+ return service
serviceMaker = WarpServiceMaker()
Please sign in to comment.
Something went wrong with that request. Please try again.