Rename docstring Kwargs to Keyword Args

This commit is contained in:
Griatch 2020-07-10 15:05:18 +02:00
parent 29fc31bb01
commit 7fed14d233
58 changed files with 203 additions and 213 deletions

View file

@ -57,7 +57,7 @@ class ConnectionWizard(object):
"""
Ask a yes/no question inline.
Kwargs:
Keyword args:
prompt (str): The prompt to ask.
default (str): "yes" or "no", used if pressing return.
Returns:
@ -83,7 +83,7 @@ class ConnectionWizard(object):
"""
Ask multiple-choice question, get response inline.
Kwargs:
Keyword args:
prompt (str): Input prompt.
options (list): List of options. Will be indexable by sequence number 1...
default (int): The list index+1 of the default choice, if any
@ -114,7 +114,7 @@ class ConnectionWizard(object):
"""
Get arbitrary input inline.
Kwargs:
Keyword args:
prompt (str): The display prompt.
default (str): If empty input, use this.
validator (callable): If given, the input will be passed

View file

@ -1642,7 +1642,7 @@ def error_check_python_modules(show_warnings=False):
python source files themselves). Best they fail already here
before we get any further.
Kwargs:
Keyword args:
show_warnings (bool): If non-fatal warning messages should be shown.
"""

View file

@ -164,7 +164,7 @@ def client_options(session, *args, **kwargs):
This allows the client an OOB way to inform us about its name and capabilities.
This will be integrated into the session settings
Kwargs:
Keyword args:
get (bool): If this is true, return the settings as a dict
(ignore all other kwargs).
client (str): A client identifier, like "mushclient".
@ -282,7 +282,7 @@ def login(session, *args, **kwargs):
Peform a login. This only works if session is currently not logged
in. This will also automatically throttle too quick attempts.
Kwargs:
Keyword args:
name (str): Account name
password (str): Plain-text password
@ -308,7 +308,7 @@ def get_value(session, *args, **kwargs):
Return the value of a given attribute or db_property on the
session's current account or character.
Kwargs:
Keyword args:
name (str): Name of info value to return. Only names
in the _gettable dictionary earlier in this module
are accepted.
@ -325,7 +325,7 @@ def _testrepeat(**kwargs):
This is a test function for using with the repeat
inputfunc.
Kwargs:
Keyword args:
session (Session): Session to return to.
"""
import time
@ -342,7 +342,7 @@ def repeat(session, *args, **kwargs):
this is meant as an example of limiting the number of
possible call functions.
Kwargs:
Keyword args:
callback (str): The function to call. Only functions
from the _repeatable dictionary earlier in this
module are available.
@ -403,7 +403,7 @@ def monitor(session, *args, **kwargs):
"""
Adds monitoring to a given property or Attribute.
Kwargs:
Keyword args:
name (str): The name of the property or Attribute
to report. No db_* prefix is needed. Only names
in the _monitorable dict earlier in this module
@ -485,7 +485,7 @@ def webclient_options(session, *args, **kwargs):
If kwargs is not empty, the key/values stored in there will be persisted
to the account object.
Kwargs:
Keyword args:
<option name>: an option to save
"""
account = session.account

View file

@ -303,7 +303,7 @@ class GrapevineClient(WebSocketClientProtocol, Session):
"""
Send data grapevine -> Evennia
Kwargs:
Keyword args:
data (dict): Converted json data.
"""

View file

@ -275,7 +275,7 @@ class IRCBot(irc.IRCClient, Session):
"""
Data IRC -> Server.
Kwargs:
Keyword args:
text (str): Ingoing text.
kwargs (any): Other data from protocol.
@ -306,7 +306,7 @@ class IRCBot(irc.IRCClient, Session):
Args:
text (str): Outgoing text.
Kwargs:
Keyword args:
user (str): the nick to send
privately to.
@ -375,7 +375,7 @@ class IRCBotFactory(protocol.ReconnectingClientFactory):
Args:
sessionhandler (SessionHandler): Reference to the main Sessionhandler.
Kwargs:
Keyword args:
uid (int): Bot user id.
botname (str): Bot name (seen in IRC channel).
channel (str): IRC channel to connect to.

View file

@ -389,7 +389,7 @@ class PortalSessionHandler(SessionHandler):
Args:
session (PortalSession): Session receiving data.
Kwargs:
Keyword args:
kwargs (any): Other data from protocol.
Notes:
@ -447,7 +447,7 @@ class PortalSessionHandler(SessionHandler):
Args:
session (Session): Session sending data.
Kwargs:
Keyword args:
kwargs (any): Each key is a command instruction to the
protocol on the form key = [[args],{kwargs}]. This will
call a method send_<key> on the protocol. If no such

View file

@ -88,7 +88,7 @@ class RSSReader(Session):
"""
Data RSS -> Evennia.
Kwargs:
Keyword args:
text (str): Incoming text
kwargs (any): Options from protocol.

View file

@ -264,7 +264,7 @@ class SshProtocol(Manhole, _BASE_SESSION_CLASS):
"""
Data Evennia -> User
Kwargs:
Keyword args:
kwargs (any): Options to the protocol.
"""
@ -277,18 +277,18 @@ class SshProtocol(Manhole, _BASE_SESSION_CLASS):
Args:
text (str): The first argument is always the text string to send. No other arguments
are considered.
Kwargs:
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!
- 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

@ -357,7 +357,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, _BASE_SESSION_CLASS):
"""
Data User -> Evennia
Kwargs:
Keyword args:
kwargs (any): Options from the protocol.
"""
@ -370,7 +370,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, _BASE_SESSION_CLASS):
"""
Data Evennia -> User
Kwargs:
Keyword args:
kwargs (any): Options to the protocol
"""
self.sessionhandler.data_out(self, **kwargs)
@ -384,7 +384,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, _BASE_SESSION_CLASS):
Args:
text (str): The first argument is always the text string to send. No other arguments
are considered.
Kwargs:
Keyword args:
options (dict): Send-option flags
- mxp: Enforce MXP link support.
- ansi: Enforce no ANSI colors.

View file

@ -234,7 +234,7 @@ class WebSocketClient(WebSocketServerProtocol, _BASE_SESSION_CLASS):
Args:
text (str): Text to send.
Kwargs:
Keyword args:
options (dict): Options-dict with the following keys understood:
- raw (bool): No parsing at all (leave ansi-to-html markers unparsed).
- nocolor (bool): Clean out all color.
@ -287,7 +287,7 @@ class WebSocketClient(WebSocketServerProtocol, _BASE_SESSION_CLASS):
cmdname (str): The first argument will always be the oob cmd name.
*args (any): Remaining args will be arguments for `cmd`.
Kwargs:
Keyword args:
options (dict): These are ignored for oob commands. Use command
arguments (which can hold dicts) to send instructions to the
client instead.

View file

@ -372,7 +372,7 @@ class AjaxWebClientSession(session.Session):
"""
Data User -> Evennia
Kwargs:
Keyword args:
kwargs (any): Incoming data.
"""
@ -382,7 +382,7 @@ class AjaxWebClientSession(session.Session):
"""
Data Evennia -> User
Kwargs:
Keyword args:
kwargs (any): Options to the protocol
"""
self.sessionhandler.data_out(self, **kwargs)
@ -395,7 +395,7 @@ class AjaxWebClientSession(session.Session):
Args:
text (str): Text to send.
Kwargs:
Keyword args:
options (dict): Options-dict with the following keys understood:
- raw (bool): No parsing at all (leave ansi-to-html markers unparsed).
- nocolor (bool): Remove all color.
@ -447,7 +447,7 @@ class AjaxWebClientSession(session.Session):
cmdname (str): The first argument will always be the oob cmd name.
*args (any): Remaining args will be arguments for `cmd`.
Kwargs:
Keyword args:
options (dict): These are ignored for oob commands. Use command
arguments (which can hold dicts) to send instructions to the
client instead.

View file

@ -229,7 +229,7 @@ class ServerSession(Session):
"""
Update the protocol_flags and sync them with Portal.
Kwargs:
Keyword args:
key, value - A key:value pair to set in the
protocol_flags dictionary.
@ -247,7 +247,7 @@ class ServerSession(Session):
"""
Sending data from Evennia->Client
Kwargs:
Keyword args:
text (str or tuple)
any (str or tuple): Send-commands identified
by their keys. Or "options", carrying options
@ -261,7 +261,7 @@ class ServerSession(Session):
Receiving data from the client, sending it off to
the respective inputfuncs.
Kwargs:
Keyword args:
kwargs (any): Incoming data from protocol on
the form `{"commandname": ((args), {kwargs}),...}`
Notes:
@ -279,7 +279,7 @@ class ServerSession(Session):
Args:
text (str): String input.
Kwargs:
Keyword args:
any (str or tuple): Send-commands identified
by their keys. Or "options", carrying options
for the protocol(s).
@ -307,7 +307,7 @@ class ServerSession(Session):
session (Session): This is here to make API consistent with
Account/Object.execute_cmd. If given, data is passed to
that Session, otherwise use self.
Kwargs:
Keyword args:
Other keyword arguments will be added to the found command
object instace as variables before it executes. This is
unused by default Evennia but may be used to set flags and

View file

@ -157,7 +157,7 @@ class Session(object):
protocols can use this right away. Portal sessions
should overload this to format/handle the outgoing data as needed.
Kwargs:
Keyword args:
kwargs (any): Other data to the protocol.
"""
@ -167,7 +167,7 @@ class Session(object):
"""
Hook for protocols to send incoming data to the engine.
Kwargs:
Keyword args:
kwargs (any): Other data from the protocol.
"""

View file

@ -817,7 +817,7 @@ class ServerSessionHandler(SessionHandler):
Args:
sessions (Session): Session.
Kwargs:
Keyword args:
kwargs (any): Incoming data from protocol on
the form `{"commandname": ((args), {kwargs}),...}`

View file

@ -22,7 +22,7 @@ class Throttle(object):
"""
Allows setting of throttle parameters.
Kwargs:
Keyword args:
limit (int): Max number of failures before imposing limiter
timeout (int): number of timeout seconds after
max number of tries has been reached.