Continue to clean up docstrings

This commit is contained in:
Griatch 2020-10-08 23:23:27 +02:00
parent 72fa7b23ba
commit d449acb57b
7 changed files with 54 additions and 46 deletions

View file

@ -277,17 +277,18 @@ class SshProtocol(Manhole, session.Session):
text (str): The first argument is always the text string to send. No other arguments
are considered.
Keyword Args:
options (dict): Send-option flags
- mxp: Enforce MXP link support.
- ansi: Enforce no ANSI colors.
- xterm256: Enforce xterm256 colors, regardless of TTYPE setting.
- nocolor: Strip all colors.
- raw: Pass string through without any ansi processing
(i.e. include Evennia ansi markers but do not
convert them into ansi tokens)
- echo: Turn on/off line echo on the client. Turn
off line echo for client, for example for password.
Note that it must be actively turned back on again!
options (dict): Send-option flags:
- mxp: Enforce MXP link support.
- ansi: Enforce no ANSI colors.
- xterm256: Enforce xterm256 colors, regardless of TTYPE setting.
- nocolor: Strip all colors.
- raw: Pass string through without any ansi processing
(i.e. include Evennia ansi markers but do not
convert them into ansi tokens)
- echo: Turn on/off line echo on the client. Turn
off line echo for client, for example for password.
Note that it must be actively turned back on again!
"""
# print "telnet.send_text", args,kwargs # DEBUG

View file

@ -388,18 +388,19 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
text (str): The first argument is always the text string to send. No other arguments
are considered.
Keyword Args:
options (dict): Send-option flags
- mxp: Enforce MXP link support.
- ansi: Enforce no ANSI colors.
- xterm256: Enforce xterm256 colors, regardless of TTYPE.
- noxterm256: Enforce no xterm256 color support, regardless of TTYPE.
- nocolor: Strip all Color, regardless of ansi/xterm256 setting.
- raw: Pass string through without any ansi processing
(i.e. include Evennia ansi markers but do not
convert them into ansi tokens)
- echo: Turn on/off line echo on the client. Turn
off line echo for client, for example for password.
Note that it must be actively turned back on again!
options (dict): Send-option flags:
- mxp: Enforce MXP link support.
- ansi: Enforce no ANSI colors.
- xterm256: Enforce xterm256 colors, regardless of TTYPE.
- noxterm256: Enforce no xterm256 color support, regardless of TTYPE.
- nocolor: Strip all Color, regardless of ansi/xterm256 setting.
- raw: Pass string through without any ansi processing
(i.e. include Evennia ansi markers but do not
convert them into ansi tokens)
- echo: Turn on/off line echo on the client. Turn
off line echo for client, for example for password.
Note that it must be actively turned back on again!
"""
text = args[0] if args else ""

View file

@ -177,11 +177,13 @@ class SessionHandler(dict):
send-instruction, with the keyword itself being the name
of the instruction (like "text"). Suitable values for each
keyword are:
- arg -> [[arg], {}]
- [args] -> [[args], {}]
- {kwargs} -> [[], {kwargs}]
- [args, {kwargs}] -> [[arg], {kwargs}]
- [[args], {kwargs}] -> [[args], {kwargs}]
::
arg -> [[arg], {}]
[args] -> [[args], {}]
{kwargs} -> [[], {kwargs}]
[args, {kwargs}] -> [[arg], {kwargs}]
[[args], {kwargs}] -> [[args], {kwargs}]
Returns:
kwargs (dict): A cleaned dictionary of cmdname:[[args],{kwargs}] pairs,
@ -761,7 +763,7 @@ class ServerSessionHandler(SessionHandler):
Given a client identification hash (for session types that offer them)
return all sessions with a matching hash.
Args
Args:
csessid (str): The session hash.
Returns:
sessions (list): The sessions with matching .csessid, if any.
@ -827,7 +829,7 @@ class ServerSessionHandler(SessionHandler):
"""
Split incoming data into its inputfunc counterparts.
This should be called by the serversession.data_in
as sessionhandler.call_inputfunc(self, **kwargs).
as `sessionhandler.call_inputfunc(self, **kwargs)`.
We also intercept OOB communication here.

View file

@ -2,21 +2,24 @@
This module brings Django Signals into Evennia. These are events that
can be subscribed to by importing a given Signal and using the
following code.
::
THIS_SIGNAL.connect(callback, sender_object)
THIS_SIGNAL.connect(callback, sender_object`)
When other code calls THIS_SIGNAL.send(sender, **kwargs), the callback
When other code calls `THIS_SIGNAL.send(sender, **kwargs)`, the callback
will be triggered.
Callbacks must be in the following format:
::
def my_callback(sender, **kwargs):
...
def my_callback(sender, **kwargs):
...
This is used on top of hooks to make certain features easier to
add to contribs without necessitating a full takeover of hooks
that may be in high demand.
"""
from django.dispatch import Signal