Mercurial > libervia-backend
comparison sat/plugins/plugin_dbg_manhole.py @ 3134:48eafdab1c34
plugin manhole: added `d` to namespace as shortcut for defer.ensureDeferred
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 28 Jan 2020 22:27:42 +0100 |
parents | 2b0f739f8a46 |
children | 9d0df638c8b4 |
comparison
equal
deleted
inserted
replaced
3133:87b8808ac49d | 3134:48eafdab1c34 |
---|---|
20 from sat.core.i18n import _ | 20 from sat.core.i18n import _ |
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, defer |
26 from twisted.words.protocols.jabber import jid | 26 from twisted.words.protocols.jabber import jid |
27 from twisted.conch.manhole import ColoredManhole | 27 from twisted.conch.manhole import ColoredManhole |
28 | 28 |
29 log = getLogger(__name__) | 29 log = getLogger(__name__) |
30 | 30 |
57 f = protocol.ServerFactory() | 57 f = protocol.ServerFactory() |
58 namespace = { | 58 namespace = { |
59 "host": self.host, | 59 "host": self.host, |
60 "C": C, | 60 "C": C, |
61 "jid": jid, | 61 "jid": jid, |
62 "d": defer.ensureDeferred, | |
62 } | 63 } |
63 f.protocol = lambda: TelnetTransport(TelnetBootstrapProtocol, | 64 f.protocol = lambda: TelnetTransport(TelnetBootstrapProtocol, |
64 insults.ServerProtocol, | 65 insults.ServerProtocol, |
65 ColoredManhole, | 66 ColoredManhole, |
66 namespace=namespace, | 67 namespace=namespace, |