Mercurial > libervia-backend
comparison sat/plugins/plugin_dbg_manhole.py @ 2837:e2005dd39c92
plugin manhole: added "jid" module to globals
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 03 Mar 2019 17:17:07 +0100 |
parents | 12d1ca646af1 |
children | ab2696e34d29 |
comparison
equal
deleted
inserted
replaced
2836:ad00f61fd9f5 | 2837:e2005dd39c92 |
---|---|
21 from sat.core.constants import Const as C | 21 from sat.core.constants import Const as C |
22 from sat.core.log import getLogger | 22 from sat.core.log import getLogger |
23 from twisted.conch.insults import insults | 23 from twisted.conch.insults import insults |
24 from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol | 24 from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol |
25 from twisted.internet import reactor, protocol | 25 from twisted.internet import reactor, protocol |
26 from twisted.words.protocols.jabber import jid | |
26 from twisted.conch.manhole import ColoredManhole | 27 from twisted.conch.manhole import ColoredManhole |
27 | 28 |
28 log = getLogger(__name__) | 29 log = getLogger(__name__) |
29 | 30 |
30 PLUGIN_INFO = { | 31 PLUGIN_INFO = { |
54 log.info(_(u"You can connect to manhole server using telnet on port {port}") | 55 log.info(_(u"You can connect to manhole server using telnet on port {port}") |
55 .format(port=port)) | 56 .format(port=port)) |
56 f = protocol.ServerFactory() | 57 f = protocol.ServerFactory() |
57 namespace = { | 58 namespace = { |
58 u"host": self.host, | 59 u"host": self.host, |
60 u"jid": jid, | |
59 } | 61 } |
60 f.protocol = lambda: TelnetTransport(TelnetBootstrapProtocol, | 62 f.protocol = lambda: TelnetTransport(TelnetBootstrapProtocol, |
61 insults.ServerProtocol, | 63 insults.ServerProtocol, |
62 ColoredManhole, | 64 ColoredManhole, |
63 namespace=namespace, | 65 namespace=namespace, |