Fixed keyword name and arguments for the telnet option ECHO.
This commit is contained in:
parent
efd2eeafb8
commit
b5507b0fcb
2 changed files with 12 additions and 13 deletions
|
|
@ -88,7 +88,7 @@ class CmdUsernameSelect(Command):
|
||||||
else:
|
else:
|
||||||
# store the player so next step can find it
|
# store the player so next step can find it
|
||||||
self.menutree.player = player
|
self.menutree.player = player
|
||||||
self.caller.msg("", switchecho="off")
|
self.caller.msg("", echo=False)
|
||||||
self.menutree.goto("node1b")
|
self.menutree.goto("node1b")
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -104,7 +104,7 @@ class CmdPasswordSelectBack(Command):
|
||||||
def func(self):
|
def func(self):
|
||||||
"Execute the command"
|
"Execute the command"
|
||||||
self.menutree.goto("node1a")
|
self.menutree.goto("node1a")
|
||||||
self.caller.msg("", switchecho="on")
|
self.caller.msg("", echo=True)
|
||||||
|
|
||||||
|
|
||||||
class CmdPasswordSelect(Command):
|
class CmdPasswordSelect(Command):
|
||||||
|
|
@ -116,7 +116,7 @@ class CmdPasswordSelect(Command):
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
"Execute the command"
|
"Execute the command"
|
||||||
self.caller.msg("", switchecho="on")
|
self.caller.msg("", echo=True)
|
||||||
if not hasattr(self.menutree, "player"):
|
if not hasattr(self.menutree, "player"):
|
||||||
self.caller.msg("{rSomething went wrong! The player was not remembered from last step!{n")
|
self.caller.msg("{rSomething went wrong! The player was not remembered from last step!{n")
|
||||||
self.menutree.goto("node1a")
|
self.menutree.goto("node1a")
|
||||||
|
|
@ -181,7 +181,7 @@ its and @/./+/-/_ only.{n") # this echoes the restrictions made by django's auth
|
||||||
return
|
return
|
||||||
# store the name for the next step
|
# store the name for the next step
|
||||||
self.menutree.playername = playername
|
self.menutree.playername = playername
|
||||||
self.caller.msg("", switchecho="off")
|
self.caller.msg("", echo=False)
|
||||||
self.menutree.goto("node2b")
|
self.menutree.goto("node2b")
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -194,7 +194,7 @@ class CmdPasswordCreateBack(Command):
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
"Execute the command"
|
"Execute the command"
|
||||||
self.caller.msg("", switchecho="on")
|
self.caller.msg("", echo=True)
|
||||||
self.menutree.goto("node2a")
|
self.menutree.goto("node2a")
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -206,7 +206,7 @@ class CmdPasswordCreate(Command):
|
||||||
def func(self):
|
def func(self):
|
||||||
"Execute the command"
|
"Execute the command"
|
||||||
password = self.args
|
password = self.args
|
||||||
self.caller.msg("", switchecho="on")
|
self.caller.msg("", echo=False)
|
||||||
if not hasattr(self.menutree, 'playername'):
|
if not hasattr(self.menutree, 'playername'):
|
||||||
self.caller.msg("{rSomething went wrong! Playername not remembered from previous step!{n")
|
self.caller.msg("{rSomething went wrong! Playername not remembered from previous step!{n")
|
||||||
self.menutree.goto("node2a")
|
self.menutree.goto("node2a")
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
||||||
not convert them into ansi tokens)
|
not convert them into ansi tokens)
|
||||||
prompt=<string> - supply a prompt text which gets sent without a
|
prompt=<string> - supply a prompt text which gets sent without a
|
||||||
newline added to the end
|
newline added to the end
|
||||||
switchecho="on"/"off"
|
echo=True/False
|
||||||
The telnet ttype negotiation flags, if any, are used if no kwargs
|
The telnet ttype negotiation flags, if any, are used if no kwargs
|
||||||
are given.
|
are given.
|
||||||
"""
|
"""
|
||||||
|
|
@ -234,7 +234,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
||||||
raw = kwargs.get("raw", False)
|
raw = kwargs.get("raw", False)
|
||||||
nomarkup = kwargs.get("nomarkup", not (xterm256 or useansi))
|
nomarkup = kwargs.get("nomarkup", not (xterm256 or useansi))
|
||||||
prompt = kwargs.get("prompt")
|
prompt = kwargs.get("prompt")
|
||||||
switchecho = kwargs.get("switchecho")
|
echo = kwargs.get("echo", None)
|
||||||
#print "telnet kwargs=%s, message=%s" % (kwargs, text)
|
#print "telnet kwargs=%s, message=%s" % (kwargs, text)
|
||||||
#print "xterm256=%s, useansi=%s, raw=%s, nomarkup=%s, init_done=%s" % (xterm256, useansi, raw, nomarkup, ttype.get("init_done"))
|
#print "xterm256=%s, useansi=%s, raw=%s, nomarkup=%s, init_done=%s" % (xterm256, useansi, raw, nomarkup, ttype.get("init_done"))
|
||||||
if raw:
|
if raw:
|
||||||
|
|
@ -252,9 +252,8 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
||||||
prompt = prompt.replace(IAC, IAC + IAC).replace('\n', '\r\n')
|
prompt = prompt.replace(IAC, IAC + IAC).replace('\n', '\r\n')
|
||||||
prompt += IAC + GA
|
prompt += IAC + GA
|
||||||
self.transport.write(mccp_compress(self, prompt))
|
self.transport.write(mccp_compress(self, prompt))
|
||||||
if switchecho:
|
if echo:
|
||||||
if switchecho == "on":
|
|
||||||
self.transport.write(mccp_compress(self, IAC+WONT+ECHO))
|
self.transport.write(mccp_compress(self, IAC+WONT+ECHO))
|
||||||
if switchecho == "off":
|
elif echo== False:
|
||||||
self.transport.write(mccp_compress(self, IAC+WILL+ECHO))
|
self.transport.write(mccp_compress(self, IAC+WILL+ECHO))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue