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

@ -1,5 +1,6 @@
# API # API
- [evennia](api:evennia) - root of API
- [evennia.accounts](api:evennia.accounts) - the out-of-character entity representing players - [evennia.accounts](api:evennia.accounts) - the out-of-character entity representing players
- [evennia.commands](api:evennia.commands) - all inputs. Also includes default commands - [evennia.commands](api:evennia.commands) - all inputs. Also includes default commands
- [evennia.comms](api:evennia.comms) - in-game channels and messaging - [evennia.comms](api:evennia.comms) - in-game channels and messaging

View file

@ -211,7 +211,7 @@ if not _no_autodoc:
if _no_autodoc: if _no_autodoc:
exclude_patterns = ["api/*"] exclude_patterns = ["api/*"]
else: else:
exclude_patterns = ["api/*migrations.rst"] exclude_patterns = ["api/*migrations.rst", "api/*tests.rst"]
autodoc_default_options = { autodoc_default_options = {
"members": True, "members": True,

View file

@ -5,7 +5,7 @@ This is the main top-level API for Evennia. You can explore the evennia library
by accessing evennia.<subpackage> directly. From inside the game you can read by accessing evennia.<subpackage> directly. From inside the game you can read
docs of all object by viewing its `__doc__` string, such as through docs of all object by viewing its `__doc__` string, such as through
@py evennia.ObjectDB.__doc__ py evennia.ObjectDB.__doc__
For full functionality you should explore this module via a django- For full functionality you should explore this module via a django-
aware shell. Go to your game directory and use the command aware shell. Go to your game directory and use the command
@ -20,27 +20,13 @@ See www.evennia.com for full documentation.
# docstring header # docstring header
DOCSTRING = """ DOCSTRING = """
|cEvennia|n 'flat' API (use |wevennia.<component>.__doc__|n to read doc-strings Evennia MU* creation system.
and |wdict(evennia.component)|n or
|wevennia.component.__dict__ to see contents) Online manual and API docs are found at http://www.evennia.com.
|cTypeclass-bases:|n |cDatabase models|n:
DefaultAccount DefaultObject AccountDB ObjectDB Flat-API shortcut names:
DefaultGuest DefaultCharacter ChannelDB {}
DefaultRoom ScriptDB """
DefaultChannel DefaultExit Msg
DefaultScript
|cSearch functions:|n |cCommand parents and helpers:|n
search_account search_object default_cmds
search_script search_channel Command InterruptCommand
search_help search_message CmdSet
search_tag managers |cUtilities:|n
|cCreate functions:|n settings lockfuncs
create_account create_object logger gametime
create_script create_channel ansi spawn
create_help_entry create_message contrib managers
|cGlobal handlers:|n set_trace
TICKER_HANDLER TASK_HANDLER EvMenu EvTable
SESSION_HANDLER CHANNEL_HANDLER EvForm EvEditor """
# Delayed loading of properties # Delayed loading of properties
@ -248,10 +234,6 @@ def _init():
from .utils.containers import GLOBAL_SCRIPTS from .utils.containers import GLOBAL_SCRIPTS
from .utils.containers import OPTION_CLASSES from .utils.containers import OPTION_CLASSES
# initialize the doc string
global __doc__
__doc__ = ansi.parse_ansi(DOCSTRING)
# API containers # API containers
class _EvContainer(object): class _EvContainer(object):
@ -461,9 +443,17 @@ def set_trace(term_size=(140, 80), debugger="auto"):
dbg = pdb.Pdb(stdout=sys.__stdout__) dbg = pdb.Pdb(stdout=sys.__stdout__)
try: try:
# Start debugger, forcing it up one stack frame (otherwise `set_trace` will start debugger # Start debugger, forcing it up one stack frame (otherwise `set_trace`
# this point, not the actual code location) # will start debugger this point, not the actual code location)
dbg.set_trace(sys._getframe().f_back) dbg.set_trace(sys._getframe().f_back)
except Exception: except Exception:
# Stopped at breakpoint. Press 'n' to continue into the code. # Stopped at breakpoint. Press 'n' to continue into the code.
dbg.set_trace() dbg.set_trace()
# initialize the doc string
global __doc__
__doc__ = DOCSTRING.format(
"\n- " + "\n- ".join(
f"evennia.{key}" for key in sorted(globals())
if not key.startswith("_")
and key not in ("DOCSTRING", )))

View file

@ -410,7 +410,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
""" """
Checks if a given username or IP is banned. Checks if a given username or IP is banned.
Kwargs: Keyword args:
ip (str, optional): IP address. ip (str, optional): IP address.
username (str, optional): Username. username (str, optional): Username.
@ -481,7 +481,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
password (str): Password of account password (str): Password of account
ip (str, optional): IP address of client ip (str, optional): IP address of client
Kwargs: Keyword args:
session (Session, optional): Session requesting authentication session (Session, optional): Session requesting authentication
Returns: Returns:
@ -611,7 +611,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
Args: Args:
password (str): Password to validate password (str): Password to validate
Kwargs: Keyword args:
account (DefaultAccount, optional): Account object to validate the account (DefaultAccount, optional): Account object to validate the
password for. Optional, but Django includes some validators to password for. Optional, but Django includes some validators to
do things like making sure users aren't setting passwords to the do things like making sure users aren't setting passwords to the
@ -658,7 +658,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
with default (or overridden) permissions and having joined them to the with default (or overridden) permissions and having joined them to the
appropriate default channels. appropriate default channels.
Kwargs: Keyword args:
username (str): Username of Account owner username (str): Username of Account owner
password (str): Password of Account owner password (str): Password of Account owner
email (str, optional): Email address of Account owner email (str, optional): Email address of Account owner
@ -843,7 +843,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
default send behavior for the current default send behavior for the current
MULTISESSION_MODE. MULTISESSION_MODE.
options (list): Protocol-specific options. Passed on to the protocol. options (list): Protocol-specific options. Passed on to the protocol.
Kwargs: Keyword args:
any (dict): All other keywords are passed on to the protocol. any (dict): All other keywords are passed on to the protocol.
""" """
@ -891,7 +891,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
session (Session, optional): The session to be responsible session (Session, optional): The session to be responsible
for the command-send for the command-send
Kwargs: Keyword args:
kwargs (any): Other keyword arguments will be added to the kwargs (any): Other keyword arguments will be added to the
found command object instance as variables before it found command object instance as variables before it
executes. This is unused by default Evennia but may be executes. This is unused by default Evennia but may be
@ -999,7 +999,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
no_superuser_bypass (bool, optional): Turn off superuser no_superuser_bypass (bool, optional): Turn off superuser
lock bypassing. Be careful with this one. lock bypassing. Be careful with this one.
Kwargs: Keyword args:
kwargs (any): Passed to the at_access hook along with the result. kwargs (any): Passed to the at_access hook along with the result.
Returns: Returns:
@ -1143,7 +1143,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
check. check.
access_type (str): The type of access checked. access_type (str): The type of access checked.
Kwargs: Keyword args:
kwargs (any): These are passed on from the access check kwargs (any): These are passed on from the access check
and can be used to relay custom instructions from the and can be used to relay custom instructions from the
check mechanism. check mechanism.
@ -1345,7 +1345,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
text (str, optional): The message received. text (str, optional): The message received.
from_obj (any, optional): The object sending the message. from_obj (any, optional): The object sending the message.
Kwargs: Keyword args:
This includes any keywords sent to the `msg` method. This includes any keywords sent to the `msg` method.
Returns: Returns:
@ -1367,7 +1367,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
text (str, optional): Text to send. text (str, optional): Text to send.
to_obj (any, optional): The object to send to. to_obj (any, optional): The object to send to.
Kwargs: Keyword args:
Keywords passed from msg() Keywords passed from msg()
Notes: Notes:
@ -1526,7 +1526,7 @@ class DefaultGuest(DefaultAccount):
""" """
Gets or creates a Guest account object. Gets or creates a Guest account object.
Kwargs: Keyword args:
ip (str, optional): IP address of requestor; used for ban checking, ip (str, optional): IP address of requestor; used for ban checking,
throttling and logging throttling and logging

View file

@ -278,7 +278,7 @@ class IRCBot(Bot):
Args: Args:
text (str, optional): Incoming text from channel. text (str, optional): Incoming text from channel.
Kwargs: Keyword args:
options (dict): Options dict with the following allowed keys: options (dict): Options dict with the following allowed keys:
- from_channel (str): dbid of a channel this text originated from. - from_channel (str): dbid of a channel this text originated from.
- from_obj (list): list of objects sending this text. - from_obj (list): list of objects sending this text.
@ -308,7 +308,7 @@ class IRCBot(Bot):
session (Session, optional): Session responsible for this session (Session, optional): Session responsible for this
command. Note that this is the bot. command. Note that this is the bot.
txt (str, optional): Command string. txt (str, optional): Command string.
Kwargs: Keyword args:
user (str): The name of the user who sent the message. user (str): The name of the user who sent the message.
channel (str): The name of channel the message was sent to. channel (str): The name of channel the message was sent to.
type (str): Nature of message. Either 'msg', 'action', 'nicklist' type (str): Nature of message. Either 'msg', 'action', 'nicklist'
@ -518,7 +518,7 @@ class GrapevineBot(Bot):
Args: Args:
text (str, optional): Incoming text from channel. text (str, optional): Incoming text from channel.
Kwargs: Keyword args:
options (dict): Options dict with the following allowed keys: options (dict): Options dict with the following allowed keys:
- from_channel (str): dbid of a channel this text originated from. - from_channel (str): dbid of a channel this text originated from.
- from_obj (list): list of objects sending this text. - from_obj (list): list of objects sending this text.

View file

@ -540,7 +540,7 @@ def cmdhandler(
is made available as `self.cmdstring` when the Command runs. is made available as `self.cmdstring` when the Command runs.
If not given, the command will be assumed to be called as `cmdobj.key`. If not given, the command will be assumed to be called as `cmdobj.key`.
Kwargs: Keyword args:
kwargs (any): other keyword arguments will be assigned as named variables on the kwargs (any): other keyword arguments will be assigned as named variables on the
retrieved command object *before* it is executed. This is unused retrieved command object *before* it is executed. This is unused
in default Evennia but may be used by code to set custom flags or in default Evennia but may be used by code to set custom flags or

View file

@ -349,7 +349,7 @@ class Command(object, metaclass=CommandMeta):
session (Session, optional): Supply data only to a unique session (Session, optional): Supply data only to a unique
session (ignores the value of `self.msg_all_sessions`). session (ignores the value of `self.msg_all_sessions`).
Kwargs: Keyword args:
options (dict): Options to the protocol. options (dict): Options to the protocol.
any (any): All other keywords are interpreted as th any (any): All other keywords are interpreted as th
name of send-instructions. name of send-instructions.
@ -375,7 +375,7 @@ class Command(object, metaclass=CommandMeta):
obj (Object or Account, optional): Object or Account on which to call the execute_cmd. obj (Object or Account, optional): Object or Account on which to call the execute_cmd.
If not given, self.caller will be used. If not given, self.caller will be used.
Kwargs: Keyword args:
Other keyword arguments will be added to the found command Other keyword arguments will be added to the found command
object instace as variables before it executes. This is object instace as variables before it executes. This is
unused by default Evennia but may be used to set flags and unused by default Evennia but may be used to set flags and
@ -523,7 +523,7 @@ Command {self} has no defined `func()` - showing on-command variables:
Args: Args:
*args (str): Column headers. If not colored explicitly, these will get colors *args (str): Column headers. If not colored explicitly, these will get colors
from user options. from user options.
Kwargs: Keyword args:
any (str, int or dict): EvTable options, including, optionally a `table` dict any (str, int or dict): EvTable options, including, optionally a `table` dict
detailing the contents of the table. detailing the contents of the table.
Returns: Returns:
@ -576,7 +576,7 @@ Command {self} has no defined `func()` - showing on-command variables:
""" """
Helper for formatting a string into a pretty display, for a header, separator or footer. Helper for formatting a string into a pretty display, for a header, separator or footer.
Kwargs: Keyword args:
header_text (str): Text to include in header. header_text (str): Text to include in header.
fill_character (str): This single character will be used to fill the width of the fill_character (str): This single character will be used to fill the width of the
display. display.

View file

@ -253,7 +253,7 @@ class DefaultChannel(ChannelDB, metaclass=TypeclassBase):
key (str): This must be unique. key (str): This must be unique.
account (Account): Account to attribute this object to. account (Account): Account to attribute this object to.
Kwargs: Keyword args:
aliases (list of str): List of alternative (likely shorter) keynames. aliases (list of str): List of alternative (likely shorter) keynames.
description (str): A description of the channel, for use in listings. description (str): A description of the channel, for use in listings.
locks (str): Lockstring. locks (str): Lockstring.

View file

@ -175,7 +175,7 @@ def _call_or_get(value, menu=None, choice=None, string=None, obj=None, caller=No
Args: Args:
value (any): the value to obtain. It might be a callable (see note). value (any): the value to obtain. It might be a callable (see note).
Kwargs: Keyword args:
menu (BuildingMenu, optional): the building menu to pass to value menu (BuildingMenu, optional): the building menu to pass to value
if it is a callable. if it is a callable.
choice (Choice, optional): the choice to pass to value if a callable. choice (Choice, optional): the choice to pass to value if a callable.

View file

@ -160,7 +160,7 @@ def get_worn_clothes(character, exclude_covered=False):
Args: Args:
character (obj): The character to get a list of worn clothes from. character (obj): The character to get a list of worn clothes from.
Kwargs: Keyword args:
exclude_covered (bool): If True, excludes clothes covered by other exclude_covered (bool): If True, excludes clothes covered by other
clothing from the returned list. clothing from the returned list.
@ -237,7 +237,7 @@ class Clothing(DefaultObject):
wearer (obj): character object wearing this clothing object wearer (obj): character object wearing this clothing object
wearstyle (True or str): string describing the style of wear or True for none wearstyle (True or str): string describing the style of wear or True for none
Kwargs: Keyword args:
quiet (bool): If false, does not message the room quiet (bool): If false, does not message the room
Notes: Notes:
@ -276,7 +276,7 @@ class Clothing(DefaultObject):
Args: Args:
wearer (obj): character object wearing this clothing object wearer (obj): character object wearing this clothing object
Kwargs: Keyword args:
quiet (bool): If false, does not message the room quiet (bool): If false, does not message the room
""" """
self.db.worn = False self.db.worn = False

View file

@ -95,7 +95,7 @@ def gametime_to_realtime(format=False, **kwargs):
in-game, you will be able to find the number of real-world seconds this in-game, you will be able to find the number of real-world seconds this
corresponds to (hint: Interval events deal with real life seconds). corresponds to (hint: Interval events deal with real life seconds).
Kwargs: Keyword args:
format (bool): Formatting the output. format (bool): Formatting the output.
days, month etc (int): These are the names of time units that must days, month etc (int): These are the names of time units that must
match the `settings.TIME_UNITS` dict keys. match the `settings.TIME_UNITS` dict keys.
@ -131,7 +131,7 @@ def realtime_to_gametime(secs=0, mins=0, hrs=0, days=0, weeks=0, months=0, yrs=0
interval would correspond to. This is usually a lot less interval would correspond to. This is usually a lot less
interesting than the other way around. interesting than the other way around.
Kwargs: Keyword args:
times (int): The various components of the time. times (int): The various components of the time.
format (bool): Formatting the output. format (bool): Formatting the output.

View file

@ -219,7 +219,7 @@ class BaseState(object):
""" """
This is a convenience-wrapper for quickly building EvscapeRoom objects. This is a convenience-wrapper for quickly building EvscapeRoom objects.
Kwargs: Keyword args:
typeclass (str): This can take just the class-name in the evscaperoom's typeclass (str): This can take just the class-name in the evscaperoom's
objects.py module. Otherwise, a full path or the actual class objects.py module. Otherwise, a full path or the actual class
is needed (for custom state objects, just give the class directly). is needed (for custom state objects, just give the class directly).

View file

@ -27,7 +27,7 @@ def create_evscaperoom_object(
Note that for the purpose of the Evscaperoom, we only allow one instance Note that for the purpose of the Evscaperoom, we only allow one instance
of each *name*, deleting the old version if it already exists. of each *name*, deleting the old version if it already exists.
Kwargs: Keyword args:
typeclass (str): This can take just the class-name in the evscaperoom's typeclass (str): This can take just the class-name in the evscaperoom's
objects.py module. Otherwise, a full path is needed. objects.py module. Otherwise, a full path is needed.
key (str): Name of object. key (str): Name of object.
@ -69,7 +69,7 @@ def create_fantasy_word(length=5, capitalize=True):
""" """
Create a random semi-pronouncable 'word'. Create a random semi-pronouncable 'word'.
Kwargs: Keyword args:
length (int): The desired length of the 'word'. length (int): The desired length of the 'word'.
capitalize (bool): If the return should be capitalized or not capitalize (bool): If the return should be capitalized or not
Returns: Returns:

View file

@ -155,7 +155,7 @@ class CallbackHandler(object):
callback_name (str): the callback name to call. callback_name (str): the callback name to call.
*args: additional variables for this callback. *args: additional variables for this callback.
Kwargs: Keyword args:
number (int, optional): call just a specific callback. number (int, optional): call just a specific callback.
parameters (str, optional): call a callback with parameters. parameters (str, optional): call a callback with parameters.
locals (dict, optional): a locals replacement. locals (dict, optional): a locals replacement.

View file

@ -28,7 +28,7 @@ def get(**kwargs):
""" """
Return an object with the given search option or None if None is found. Return an object with the given search option or None if None is found.
Kwargs: Keyword args:
Any searchable data or property (id, db_key, db_location...). Any searchable data or property (id, db_key, db_location...).
Returns: Returns:

View file

@ -397,7 +397,7 @@ class EventHandler(DefaultScript):
callback_name (str): the callback name to call. callback_name (str): the callback name to call.
*args: additional variables for this callback. *args: additional variables for this callback.
Kwargs: Keyword args:
number (int, optional): call just a specific callback. number (int, optional): call just a specific callback.
parameters (str, optional): call a callback with parameters. parameters (str, optional): call a callback with parameters.
locals (dict, optional): a locals replacement. locals (dict, optional): a locals replacement.

View file

@ -421,7 +421,7 @@ class EventCharacter(DefaultCharacter):
Args: Args:
message (str): The suggested say/whisper text spoken by self. message (str): The suggested say/whisper text spoken by self.
Kwargs: Keyword args:
whisper (bool): If True, this is a whisper rather than whisper (bool): If True, this is a whisper rather than
a say. This is sent by the whisper command by default. a say. This is sent by the whisper command by default.
Other verbal commands could use this hook in similar Other verbal commands could use this hook in similar
@ -477,7 +477,7 @@ class EventCharacter(DefaultCharacter):
(by default only used by whispers). (by default only used by whispers).
msg_receiver(str, optional): Specific message for receiver only. msg_receiver(str, optional): Specific message for receiver only.
mapping (dict, optional): Additional mapping in messages. mapping (dict, optional): Additional mapping in messages.
Kwargs: Keyword args:
whisper (bool): If this is a whisper rather than a say. Kwargs whisper (bool): If this is a whisper rather than a say. Kwargs
can be used by other verbal commands in a similar way. can be used by other verbal commands in a similar way.

View file

@ -1420,7 +1420,7 @@ class ContribRPObject(DefaultObject):
looker (TypedObject): The object or account that is looking looker (TypedObject): The object or account that is looking
at/getting inforamtion for this object. at/getting inforamtion for this object.
Kwargs: Keyword args:
pose (bool): Include the pose (if available) in the return. pose (bool): Include the pose (if available) in the return.
Returns: Returns:
@ -1508,7 +1508,7 @@ class ContribRPCharacter(DefaultCharacter, ContribRPObject):
looker (TypedObject): The object or account that is looking looker (TypedObject): The object or account that is looking
at/getting inforamtion for this object. at/getting inforamtion for this object.
Kwargs: Keyword args:
pose (bool): Include the pose (if available) in the return. pose (bool): Include the pose (if available) in the return.
Returns: Returns:
@ -1557,7 +1557,7 @@ class ContribRPCharacter(DefaultCharacter, ContribRPObject):
Args: Args:
message (str): The suggested say/whisper text spoken by self. message (str): The suggested say/whisper text spoken by self.
Kwargs: Keyword args:
whisper (bool): If True, this is a whisper rather than a say. whisper (bool): If True, this is a whisper rather than a say.
""" """

View file

@ -70,7 +70,7 @@ class AuditedServerSession(ServerSession):
Extracts messages and system data from a Session object upon message Extracts messages and system data from a Session object upon message
send or receive. send or receive.
Kwargs: Keyword args:
src (str): Source of data; 'client' or 'server'. Indicates direction. src (str): Source of data; 'client' or 'server'. Indicates direction.
text (str or list): Client sends messages to server in the form of text (str or list): Client sends messages to server in the form of
lists. Server sends messages to client as string. lists. Server sends messages to client as string.
@ -216,7 +216,7 @@ class AuditedServerSession(ServerSession):
""" """
Generic hook for sending data out through the protocol. Generic hook for sending data out through the protocol.
Kwargs: Keyword args:
kwargs (any): Other data to the protocol. kwargs (any): Other data to the protocol.
""" """
@ -234,7 +234,7 @@ class AuditedServerSession(ServerSession):
""" """
Hook for protocols to send incoming data to the engine. Hook for protocols to send incoming data to the engine.
Kwargs: Keyword args:
kwargs (any): Other data from the protocol. kwargs (any): Other data from the protocol.
""" """

View file

@ -279,7 +279,7 @@ def spend_action(character, actions, action_name=None):
character (obj): Character spending the action character (obj): Character spending the action
actions (int) or 'all': Number of actions to spend, or 'all' to spend all actions actions (int) or 'all': Number of actions to spend, or 'all' to spend all actions
Kwargs: Keyword args:
action_name (str or None): If a string is given, sets character's last action in action_name (str or None): If a string is given, sets character's last action in
combat to provided string combat to provided string
""" """

View file

@ -330,7 +330,7 @@ def spend_action(character, actions, action_name=None):
character (obj): Character spending the action character (obj): Character spending the action
actions (int) or 'all': Number of actions to spend, or 'all' to spend all actions actions (int) or 'all': Number of actions to spend, or 'all' to spend all actions
Kwargs: Keyword args:
action_name (str or None): If a string is given, sets character's last action in action_name (str or None): If a string is given, sets character's last action in
combat to provided string combat to provided string
""" """

View file

@ -348,7 +348,7 @@ def spend_action(character, actions, action_name=None):
character (obj): Character spending the action character (obj): Character spending the action
actions (int) or 'all': Number of actions to spend, or 'all' to spend all actions actions (int) or 'all': Number of actions to spend, or 'all' to spend all actions
Kwargs: Keyword args:
action_name (str or None): If a string is given, sets character's last action in action_name (str or None): If a string is given, sets character's last action in
combat to provided string combat to provided string
""" """

View file

@ -304,7 +304,7 @@ def spend_action(character, actions, action_name=None):
character (obj): Character spending the action character (obj): Character spending the action
actions (int) or 'all': Number of actions to spend, or 'all' to spend all actions actions (int) or 'all': Number of actions to spend, or 'all' to spend all actions
Kwargs: Keyword args:
action_name (str or None): If a string is given, sets character's last action in action_name (str or None): If a string is given, sets character's last action in
combat to provided string combat to provided string
""" """

View file

@ -470,7 +470,7 @@ def spend_action(character, actions, action_name=None):
character (obj): Character spending the action character (obj): Character spending the action
actions (int) or 'all': Number of actions to spend, or 'all' to spend all actions actions (int) or 'all': Number of actions to spend, or 'all' to spend all actions
Kwargs: Keyword args:
action_name (str or None): If a string is given, sets character's last action in action_name (str or None): If a string is given, sets character's last action in
combat to provided string combat to provided string
""" """
@ -642,7 +642,7 @@ class TBRangeTurnHandler(DefaultScript):
Args: Args:
to_init (object): Object to initialize range field for. to_init (object): Object to initialize range field for.
Kwargs: Keyword args:
anchor_obj (object): Object to copy range values from, or None for a random object. anchor_obj (object): Object to copy range values from, or None for a random object.
add_distance (int): Distance to put between to_init object and anchor object. add_distance (int): Distance to put between to_init object and anchor object.

View file

@ -98,7 +98,7 @@ class UnixCommandParser(argparse.ArgumentParser):
epilog (str): the epilog to show below options. epilog (str): the epilog to show below options.
command (Command): the command calling the parser. command (Command): the command calling the parser.
Kwargs: Keyword args:
Additional keyword arguments are directly sent to Additional keyword arguments are directly sent to
`argparse.ArgumentParser`. You will find them on the `argparse.ArgumentParser`. You will find them on the
[parser's documentation](https://docs.python.org/2/library/argparse.html). [parser's documentation](https://docs.python.org/2/library/argparse.html).

View file

@ -42,7 +42,7 @@ def at_search_result(matches, caller, query="", quiet=False, **kwargs):
quiet (bool, optional): If `True`, no messages will be echoed to caller quiet (bool, optional): If `True`, no messages will be echoed to caller
on errors. on errors.
Kwargs: Keyword args:
nofound_string (str): Replacement string to echo on a notfound error. nofound_string (str): Replacement string to echo on a notfound error.
multimatch_string (str): Replacement string to echo on a multimatch error. multimatch_string (str): Replacement string to echo on a multimatch error.

View file

@ -337,7 +337,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
Args: Args:
count (int): Number of objects of this type count (int): Number of objects of this type
looker (Object): Onlooker. Not used by default. looker (Object): Onlooker. Not used by default.
Kwargs: Keyword args:
key (str): Optional key to pluralize, if given, use this instead of the object's key. key (str): Optional key to pluralize, if given, use this instead of the object's key.
Returns: Returns:
singular (str): The singular form to display. singular (str): The singular form to display.
@ -559,7 +559,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
session (Session, optional): Session to session (Session, optional): Session to
return results to return results to
Kwargs: Keyword args:
Other keyword arguments will be added to the found command Other keyword arguments will be added to the found command
object instace as variables before it executes. This is object instace as variables before it executes. This is
unused by default Evennia but may be used to set flags and unused by default Evennia but may be used to set flags and
@ -605,7 +605,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
depends on the MULTISESSION_MODE. depends on the MULTISESSION_MODE.
options (dict, optional): Message-specific option-value options (dict, optional): Message-specific option-value
pairs. These will be applied at the protocol level. pairs. These will be applied at the protocol level.
Kwargs: Keyword args:
any (string or tuples): All kwarg keys not listed above any (string or tuples): All kwarg keys not listed above
will be treated as send-command names and their arguments will be treated as send-command names and their arguments
(which can be a string or a tuple). (which can be a string or a tuple).
@ -656,7 +656,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
exclude (list, optional): A list of object not to call the exclude (list, optional): A list of object not to call the
function on. function on.
Kwargs: Keyword args:
Keyword arguments will be passed to the function for all objects. Keyword arguments will be passed to the function for all objects.
""" """
contents = self.contents contents = self.contents
@ -688,7 +688,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
for every looker in contents that receives the for every looker in contents that receives the
message. This allows for every object to potentially message. This allows for every object to potentially
get its own customized string. get its own customized string.
Kwargs: Keyword args:
Keyword arguments will be passed on to `obj.msg()` for all Keyword arguments will be passed on to `obj.msg()` for all
messaged objects. messaged objects.
@ -763,7 +763,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
(at_before/after_move etc) with quiet=True, this is as quiet a move (at_before/after_move etc) with quiet=True, this is as quiet a move
as can be done. as can be done.
Kwargs: Keyword args:
Passed on to announce_move_to and announce_move_from hooks. Passed on to announce_move_to and announce_move_from hooks.
Returns: Returns:
@ -937,7 +937,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
key (str): Name of the new object. key (str): Name of the new object.
account (Account): Account to attribute this object to. account (Account): Account to attribute this object to.
Kwargs: Keyword args:
description (str): Brief description for this object. description (str): Brief description for this object.
ip (str): IP address of creator (for object auditing). ip (str): IP address of creator (for object auditing).
@ -1103,7 +1103,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
no_superuser_bypass (bool, optional): If `True`, don't skip no_superuser_bypass (bool, optional): If `True`, don't skip
lock check for superuser (be careful with this one). lock check for superuser (be careful with this one).
Kwargs: Keyword args:
Passed on to the at_access hook along with the result of the access check. Passed on to the at_access hook along with the result of the access check.
""" """
@ -1262,7 +1262,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
place to do it. This is called also if the object currently place to do it. This is called also if the object currently
have no cmdsets. have no cmdsets.
Kwargs: Keyword args:
caller (Session, Object or Account): The caller requesting caller (Session, Object or Account): The caller requesting
this cmdset. this cmdset.
@ -1364,7 +1364,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
accessing_obj (Object or Account): The entity trying to gain access. accessing_obj (Object or Account): The entity trying to gain access.
access_type (str): The type of access that was requested. access_type (str): The type of access that was requested.
Kwargs: Keyword args:
Not used by default, added for possible expandability in a Not used by default, added for possible expandability in a
game. game.
@ -1615,7 +1615,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
text (str, optional): The message received. text (str, optional): The message received.
from_obj (any, optional): The object sending the message. from_obj (any, optional): The object sending the message.
Kwargs: Keyword args:
This includes any keywords sent to the `msg` method. This includes any keywords sent to the `msg` method.
Returns: Returns:
@ -1637,7 +1637,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
text (str, optional): Text to send. text (str, optional): Text to send.
to_obj (any, optional): The object to send to. to_obj (any, optional): The object to send to.
Kwargs: Keyword args:
Keywords passed from msg() Keywords passed from msg()
Notes: Notes:
@ -1879,7 +1879,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
Args: Args:
message (str): The suggested say/whisper text spoken by self. message (str): The suggested say/whisper text spoken by self.
Kwargs: Keyword args:
whisper (bool): If True, this is a whisper rather than whisper (bool): If True, this is a whisper rather than
a say. This is sent by the whisper command by default. a say. This is sent by the whisper command by default.
Other verbal commands could use this hook in similar Other verbal commands could use this hook in similar
@ -1919,7 +1919,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
(by default only used by whispers). (by default only used by whispers).
msg_receivers(str): Specific message to pass to the receiver(s). This will parsed msg_receivers(str): Specific message to pass to the receiver(s). This will parsed
with the {receiver} placeholder replaced with the given receiver. with the {receiver} placeholder replaced with the given receiver.
Kwargs: Keyword args:
whisper (bool): If this is a whisper rather than a say. Kwargs whisper (bool): If this is a whisper rather than a say. Kwargs
can be used by other verbal commands in a similar way. can be used by other verbal commands in a similar way.
mapping (dict): Pass an additional mapping to the message. mapping (dict): Pass an additional mapping to the message.
@ -2058,7 +2058,7 @@ class DefaultCharacter(DefaultObject):
an argument, but one can fake it out by supplying None-- it will an argument, but one can fake it out by supplying None-- it will
change the default lockset and skip creator attribution. change the default lockset and skip creator attribution.
Kwargs: Keyword args:
description (str): Brief description for this object. description (str): Brief description for this object.
ip (str): IP address of creator (for object auditing). ip (str): IP address of creator (for object auditing).
All other kwargs will be passed into the create_object call. All other kwargs will be passed into the create_object call.
@ -2316,7 +2316,7 @@ class DefaultRoom(DefaultObject):
key (str): Name of the new Room. key (str): Name of the new Room.
account (obj): Account to associate this Room with. account (obj): Account to associate this Room with.
Kwargs: Keyword args:
description (str): Brief description for this object. description (str): Brief description for this object.
ip (str): IP address of creator (for object auditing). ip (str): IP address of creator (for object auditing).
@ -2513,7 +2513,7 @@ class DefaultExit(DefaultObject):
source (Room): The room to create this exit in. source (Room): The room to create this exit in.
dest (Room): The room to which this exit should go. dest (Room): The room to which this exit should go.
Kwargs: Keyword args:
description (str): Brief description for this object. description (str): Brief description for this object.
ip (str): IP address of creator (for object auditing). ip (str): IP address of creator (for object auditing).
@ -2600,7 +2600,7 @@ class DefaultExit(DefaultObject):
place to do it. This is called also if the object currently place to do it. This is called also if the object currently
has no cmdsets. has no cmdsets.
Kwargs: Keyword args:
force_init (bool): If `True`, force a re-build of the cmdset force_init (bool): If `True`, force a re-build of the cmdset
(for example to update aliases). (for example to update aliases).

View file

@ -130,7 +130,7 @@ def _set_property(caller, raw_string, **kwargs):
caller (Object, Account): The user of the wizard. caller (Object, Account): The user of the wizard.
raw_string (str): Input from user on given node - the new value to set. raw_string (str): Input from user on given node - the new value to set.
Kwargs: Keyword args:
test_parse (bool): If set (default True), parse raw_string for protfuncs and obj-refs and test_parse (bool): If set (default True), parse raw_string for protfuncs and obj-refs and
try to run result through literal_eval. The parser will be run in 'testing' mode and any try to run result through literal_eval. The parser will be run in 'testing' mode and any
parsing errors will shown to the user. Note that this is just for testing, the original parsing errors will shown to the user. Note that this is just for testing, the original
@ -297,7 +297,7 @@ def _format_list_actions(*args, **kwargs):
Args: Args:
actions (str): Available actions. The first letter of the action name will be assumed actions (str): Available actions. The first letter of the action name will be assumed
to be a shortcut. to be a shortcut.
Kwargs: Keyword args:
prefix (str): Default prefix to use. prefix (str): Default prefix to use.
Returns: Returns:
string (str): Formatted footer for adding to the node text. string (str): Formatted footer for adding to the node text.
@ -1175,7 +1175,7 @@ def _add_attr(caller, attr_string, **kwargs):
attr = value attr = value
attr;category = value attr;category = value
attr;category;lockstring = value attr;category;lockstring = value
Kwargs: Keyword args:
delete (str): If this is set, attr_string is delete (str): If this is set, attr_string is
considered the name of the attribute to delete and considered the name of the attribute to delete and
no further parsing happens. no further parsing happens.
@ -1362,7 +1362,7 @@ def _add_tag(caller, tag_string, **kwargs):
tagname;category tagname;category
tagname;category;data tagname;category;data
Kwargs: Keyword args:
delete (str): If this is set, tag_string is considered delete (str): If this is set, tag_string is considered
the name of the tag to delete. the name of the tag to delete.
@ -1911,7 +1911,7 @@ def _add_prototype_tag(caller, tag_string, **kwargs):
caller (Object): Caller of menu. caller (Object): Caller of menu.
tag_string (str): Input from user - only tagname tag_string (str): Input from user - only tagname
Kwargs: Keyword args:
delete (str): If this is set, tag_string is considered delete (str): If this is set, tag_string is considered
the name of the tag to delete. the name of the tag to delete.
@ -2139,7 +2139,7 @@ def _format_diff_text_and_options(diff, minimal=True, **kwargs):
diff (dict): A diff as produced by `prototype_diff`. diff (dict): A diff as produced by `prototype_diff`.
minimal (bool, optional): Don't show KEEPs. minimal (bool, optional): Don't show KEEPs.
Kwargs: Keyword args:
any (any): Forwarded into the generated options as arguments to the callable. any (any): Forwarded into the generated options as arguments to the callable.
Returns: Returns:

View file

@ -324,7 +324,7 @@ def search_prototype(key=None, tags=None, require_single=False):
""" """
Find prototypes based on key and/or tags, or all prototypes. Find prototypes based on key and/or tags, or all prototypes.
Kwargs: Keyword args:
key (str): An exact or partial key to query for. key (str): An exact or partial key to query for.
tags (str or list): Tag key or keys to query for. These tags (str or list): Tag key or keys to query for. These
will always be applied with the 'db_protototype' will always be applied with the 'db_protototype'
@ -645,7 +645,7 @@ def protfunc_parser(value, available_functions=None, testing=False, stacktrace=F
behave differently. behave differently.
stacktrace (bool, optional): If set, print the stack parsing process of the protfunc-parser. stacktrace (bool, optional): If set, print the stack parsing process of the protfunc-parser.
Kwargs: Keyword args:
session (Session): Passed to protfunc. Session of the entity spawning the prototype. session (Session): Passed to protfunc. Session of the entity spawning the prototype.
protototype (dict): Passed to protfunc. The dict this protfunc is a part of. protototype (dict): Passed to protfunc. The dict this protfunc is a part of.
current_key(str): Passed to protfunc. The key in the prototype that will hold this value. current_key(str): Passed to protfunc. The key in the prototype that will hold this value.

View file

@ -841,7 +841,7 @@ def spawn(*prototypes, **kwargs):
prototypes (str or dict): Each argument should either be a prototypes (str or dict): Each argument should either be a
prototype_key (will be used to find the prototype) or a full prototype prototype_key (will be used to find the prototype) or a full prototype
dictionary. These will be batched-spawned as one object each. dictionary. These will be batched-spawned as one object each.
Kwargs: Keyword args:
prototype_modules (str or list): A python-path to a prototype prototype_modules (str or list): A python-path to a prototype
module, or a list of such paths. These will be used to build module, or a list of such paths. These will be used to build
the global protparents dictionary accessible by the input the global protparents dictionary accessible by the input

View file

@ -125,7 +125,7 @@ class MonitorHandler(object):
persistent (bool, optional): If False, the monitor will survive persistent (bool, optional): If False, the monitor will survive
a server reload but not a cold restart. This is default. a server reload but not a cold restart. This is default.
Kwargs: Keyword args:
session (Session): If this keyword is given, the monitorhandler will session (Session): If this keyword is given, the monitorhandler will
correctly analyze it and remove the monitor if after a reload/reboot correctly analyze it and remove the monitor if after a reload/reboot
the session is no longer valid. the session is no longer valid.

View file

@ -100,7 +100,7 @@ class TaskHandler(object):
callback (function or instance method): the callback itself callback (function or instance method): the callback itself
any (any): any additional positional arguments to send to the callback any (any): any additional positional arguments to send to the callback
Kwargs: Keyword args:
persistent (bool, optional): persist the task (store it). persistent (bool, optional): persist the task (store it).
any (any): additional keyword arguments to send to the callback any (any): additional keyword arguments to send to the callback

View file

@ -183,7 +183,7 @@ class Ticker(object):
store_key (str): Unique storage hash for this ticker subscription. store_key (str): Unique storage hash for this ticker subscription.
args (any, optional): Arguments to call the hook method with. args (any, optional): Arguments to call the hook method with.
Kwargs: Keyword args:
_start_delay (int): If set, this will be _start_delay (int): If set, this will be
used to delay the start of the trigger instead of used to delay the start of the trigger instead of
`interval`. `interval`.

View file

@ -57,7 +57,7 @@ class ConnectionWizard(object):
""" """
Ask a yes/no question inline. Ask a yes/no question inline.
Kwargs: Keyword args:
prompt (str): The prompt to ask. prompt (str): The prompt to ask.
default (str): "yes" or "no", used if pressing return. default (str): "yes" or "no", used if pressing return.
Returns: Returns:
@ -83,7 +83,7 @@ class ConnectionWizard(object):
""" """
Ask multiple-choice question, get response inline. Ask multiple-choice question, get response inline.
Kwargs: Keyword args:
prompt (str): Input prompt. prompt (str): Input prompt.
options (list): List of options. Will be indexable by sequence number 1... options (list): List of options. Will be indexable by sequence number 1...
default (int): The list index+1 of the default choice, if any default (int): The list index+1 of the default choice, if any
@ -114,7 +114,7 @@ class ConnectionWizard(object):
""" """
Get arbitrary input inline. Get arbitrary input inline.
Kwargs: Keyword args:
prompt (str): The display prompt. prompt (str): The display prompt.
default (str): If empty input, use this. default (str): If empty input, use this.
validator (callable): If given, the input will be passed 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 python source files themselves). Best they fail already here
before we get any further. before we get any further.
Kwargs: Keyword args:
show_warnings (bool): If non-fatal warning messages should be shown. 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 allows the client an OOB way to inform us about its name and capabilities.
This will be integrated into the session settings This will be integrated into the session settings
Kwargs: Keyword args:
get (bool): If this is true, return the settings as a dict get (bool): If this is true, return the settings as a dict
(ignore all other kwargs). (ignore all other kwargs).
client (str): A client identifier, like "mushclient". 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 Peform a login. This only works if session is currently not logged
in. This will also automatically throttle too quick attempts. in. This will also automatically throttle too quick attempts.
Kwargs: Keyword args:
name (str): Account name name (str): Account name
password (str): Plain-text password 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 Return the value of a given attribute or db_property on the
session's current account or character. session's current account or character.
Kwargs: Keyword args:
name (str): Name of info value to return. Only names name (str): Name of info value to return. Only names
in the _gettable dictionary earlier in this module in the _gettable dictionary earlier in this module
are accepted. are accepted.
@ -325,7 +325,7 @@ def _testrepeat(**kwargs):
This is a test function for using with the repeat This is a test function for using with the repeat
inputfunc. inputfunc.
Kwargs: Keyword args:
session (Session): Session to return to. session (Session): Session to return to.
""" """
import time import time
@ -342,7 +342,7 @@ def repeat(session, *args, **kwargs):
this is meant as an example of limiting the number of this is meant as an example of limiting the number of
possible call functions. possible call functions.
Kwargs: Keyword args:
callback (str): The function to call. Only functions callback (str): The function to call. Only functions
from the _repeatable dictionary earlier in this from the _repeatable dictionary earlier in this
module are available. module are available.
@ -403,7 +403,7 @@ def monitor(session, *args, **kwargs):
""" """
Adds monitoring to a given property or Attribute. Adds monitoring to a given property or Attribute.
Kwargs: Keyword args:
name (str): The name of the property or Attribute name (str): The name of the property or Attribute
to report. No db_* prefix is needed. Only names to report. No db_* prefix is needed. Only names
in the _monitorable dict earlier in this module 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 If kwargs is not empty, the key/values stored in there will be persisted
to the account object. to the account object.
Kwargs: Keyword args:
<option name>: an option to save <option name>: an option to save
""" """
account = session.account account = session.account

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1099,7 +1099,7 @@ class AttributeHandler:
- `(key, value, category, lockstring)` - `(key, value, category, lockstring)`
- `(key, value, category, lockstring, default_access)` - `(key, value, category, lockstring, default_access)`
Kwargs: Keyword args:
strattr (bool): If `True`, value must be a string. This strattr (bool): If `True`, value must be a string. This
will save the value without pickling which is less will save the value without pickling which is less
flexible but faster to search (not often used except flexible but faster to search (not often used except

View file

@ -260,7 +260,7 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager):
this is either `None` (a normal Tag), `alias` or this is either `None` (a normal Tag), `alias` or
`permission`. This always apply to all queried tags. `permission`. This always apply to all queried tags.
Kwargs: Keyword args:
match (str): "all" (default) or "any"; determines whether the match (str): "all" (default) or "any"; determines whether the
target object must be tagged with ALL of the provided target object must be tagged with ALL of the provided
tags/categories or ANY single one. ANY will perform a weighted tags/categories or ANY single one. ANY will perform a weighted
@ -651,7 +651,7 @@ class TypeclassManager(TypedObjectManager):
Args: Args:
args (any): These are passed on as arguments to the default args (any): These are passed on as arguments to the default
django get method. django get method.
Kwargs: Keyword args:
kwargs (any): These are passed on as normal arguments kwargs (any): These are passed on as normal arguments
to the default django get method to the default django get method
Returns: Returns:
@ -673,7 +673,7 @@ class TypeclassManager(TypedObjectManager):
Args: Args:
args (any): These are passed on as arguments to the default args (any): These are passed on as arguments to the default
django filter method. django filter method.
Kwargs: Keyword args:
kwargs (any): These are passed on as normal arguments kwargs (any): These are passed on as normal arguments
to the default django filter method. to the default django filter method.
Returns: Returns:
@ -796,7 +796,7 @@ class TypeclassManager(TypedObjectManager):
Variation of get that not only returns the current typeclass Variation of get that not only returns the current typeclass
but also all subclasses of that typeclass. but also all subclasses of that typeclass.
Kwargs: Keyword args:
kwargs (any): These are passed on as normal arguments kwargs (any): These are passed on as normal arguments
to the default django get method. to the default django get method.
Returns: Returns:
@ -821,7 +821,7 @@ class TypeclassManager(TypedObjectManager):
Args: Args:
args (any): These are passed on as arguments to the default args (any): These are passed on as arguments to the default
django filter method. django filter method.
Kwargs: Keyword args:
kwargs (any): These are passed on as normal arguments kwargs (any): These are passed on as normal arguments
to the default django filter method. to the default django filter method.
Returns: Returns:

View file

@ -253,7 +253,7 @@ class TypedObject(SharedMemoryModel):
Args: Args:
Passed through to parent. Passed through to parent.
Kwargs: Keyword args:
Passed through to parent. Passed through to parent.
Notes: Notes:
@ -577,7 +577,7 @@ class TypedObject(SharedMemoryModel):
no_superuser_bypass (bool, optional): Turn off the no_superuser_bypass (bool, optional): Turn off the
superuser lock bypass (be careful with this one). superuser lock bypass (be careful with this one).
Kwargs: Keyword args:
kwargs (any): Ignored, but is there to make the api kwargs (any): Ignored, but is there to make the api
consistent with the object-typeclass method access, which consistent with the object-typeclass method access, which
use it to feed to its hook methods. use it to feed to its hook methods.

View file

@ -78,7 +78,7 @@ def create_object(
Create a new in-game object. Create a new in-game object.
Kwargs: Keyword args:
typeclass (class or str): Class or python path to a typeclass. typeclass (class or str): Class or python path to a typeclass.
key (str): Name of the new object. If not set, a name of key (str): Name of the new object. If not set, a name of
#dbref will be set. #dbref will be set.
@ -206,7 +206,7 @@ def create_script(
scripts. It's behaviour is similar to the game objects except scripts. It's behaviour is similar to the game objects except
scripts has a time component and are more limited in scope. scripts has a time component and are more limited in scope.
Kwargs: Keyword args:
typeclass (class or str): Class or python path to a typeclass. typeclass (class or str): Class or python path to a typeclass.
key (str): Name of the new object. If not set, a name of key (str): Name of the new object. If not set, a name of
#dbref will be set. #dbref will be set.
@ -428,7 +428,7 @@ def create_channel(key, aliases=None, desc=None, locks=None, keep_log=True, type
Args: Args:
key (str): This must be unique. key (str): This must be unique.
Kwargs: Keyword args:
aliases (list of str): List of alternative (likely shorter) keynames. aliases (list of str): List of alternative (likely shorter) keynames.
desc (str): A description of the channel, for use in listings. desc (str): A description of the channel, for use in listings.
locks (str): Lockstring. locks (str): Lockstring.
@ -493,7 +493,7 @@ def create_account(
the empty string, will be set to None. the empty string, will be set to None.
password (str): Password in cleartext. password (str): Password in cleartext.
Kwargs: Keyword args:
typeclass (str): The typeclass to use for the account. typeclass (str): The typeclass to use for the account.
is_superuser (bool): Wether or not this account is to be a superuser is_superuser (bool): Wether or not this account is to be a superuser
locks (str): Lockstring. locks (str): Lockstring.

View file

@ -188,7 +188,7 @@ class EvForm(object):
""" """
Initiate the form Initiate the form
Kwargs: Keyword args:
filename (str): Path to template file. filename (str): Path to template file.
cells (dict): A dictionary mapping of {id:text} cells (dict): A dictionary mapping of {id:text}
tables (dict): A dictionary mapping of {id:EvTable}. tables (dict): A dictionary mapping of {id:EvTable}.

View file

@ -282,7 +282,7 @@ def wrap(text, width=_DEFAULT_WIDTH, **kwargs):
text (str): Text to wrap. text (str): Text to wrap.
width (int, optional): Width to wrap `text` to. width (int, optional): Width to wrap `text` to.
Kwargs: Keyword args:
See TextWrapper class for available keyword args to customize See TextWrapper class for available keyword args to customize
wrapping behaviour. wrapping behaviour.
@ -303,7 +303,7 @@ def fill(text, width=_DEFAULT_WIDTH, **kwargs):
text (str): Text to fill. text (str): Text to fill.
width (int, optional): Width of fill area. width (int, optional): Width of fill area.
Kwargs: Keyword args:
See TextWrapper class for available keyword args to customize See TextWrapper class for available keyword args to customize
filling behaviour. filling behaviour.
@ -328,7 +328,7 @@ class EvCell(object):
Args: Args:
data (str): The un-padded data of the entry. data (str): The un-padded data of the entry.
Kwargs: Keyword args:
width (int): Desired width of cell. It will pad width (int): Desired width of cell. It will pad
to this size. to this size.
height (int): Desired height of cell. it will pad height (int): Desired height of cell. it will pad
@ -773,7 +773,7 @@ class EvCell(object):
""" """
Reformat the EvCell with new options Reformat the EvCell with new options
Kwargs: Keyword args:
The available keyword arguments are the same as for `EvCell.__init__`. The available keyword arguments are the same as for `EvCell.__init__`.
Raises: Raises:
@ -932,7 +932,7 @@ class EvColumn(object):
Args: Args:
Text for each row in the column Text for each row in the column
Kwargs: Keyword args:
All `EvCell.__init_` keywords are available, these All `EvCell.__init_` keywords are available, these
settings will be persistently applied to every Cell in the settings will be persistently applied to every Cell in the
column. column.
@ -947,7 +947,7 @@ class EvColumn(object):
coherent and lined-up column. Will enforce column-specific coherent and lined-up column. Will enforce column-specific
options to cells. options to cells.
Kwargs: Keyword args:
Extra keywords to modify the column setting. Same keywords Extra keywords to modify the column setting. Same keywords
as in `EvCell.__init__`. as in `EvCell.__init__`.
@ -979,7 +979,7 @@ class EvColumn(object):
use `ypos=0`. If not given, data will be inserted at the end use `ypos=0`. If not given, data will be inserted at the end
of the column. of the column.
Kwargs: Keyword args:
Available keywods as per `EvCell.__init__`. Available keywods as per `EvCell.__init__`.
""" """
@ -998,7 +998,7 @@ class EvColumn(object):
""" """
Change the options for the column. Change the options for the column.
Kwargs: Keyword args:
Keywords as per `EvCell.__init__`. Keywords as per `EvCell.__init__`.
""" """
@ -1013,7 +1013,7 @@ class EvColumn(object):
index (int): Index location of the cell in the column, index (int): Index location of the cell in the column,
starting from 0 for the first row to Nrows-1. starting from 0 for the first row to Nrows-1.
Kwargs: Keyword args:
Keywords as per `EvCell.__init__`. Keywords as per `EvCell.__init__`.
""" """
@ -1053,7 +1053,7 @@ class EvTable(object):
Args: Args:
Header texts for the table. Header texts for the table.
Kwargs: Keyword args:
table (list of lists or list of `EvColumns`, optional): table (list of lists or list of `EvColumns`, optional):
This is used to build the table in a quick way. If not This is used to build the table in a quick way. If not
given, the table will start out empty and `add_` methods given, the table will start out empty and `add_` methods
@ -1207,7 +1207,7 @@ class EvTable(object):
nx (int): x size of table. nx (int): x size of table.
ny (int): y size of table. ny (int): y size of table.
Kwargs: Keyword args:
Keywords as per `EvTable.__init__`. Keywords as per `EvTable.__init__`.
Returns: Returns:
@ -1534,7 +1534,7 @@ class EvTable(object):
Args: Args:
args (str): These strings will be used as the header texts. args (str): These strings will be used as the header texts.
Kwargs: Keyword args:
Same keywords as per `EvTable.__init__`. Will be applied Same keywords as per `EvTable.__init__`. Will be applied
to the new header's cells. to the new header's cells.
@ -1558,7 +1558,7 @@ class EvTable(object):
to input new column. If not given, column will be added to the end to input new column. If not given, column will be added to the end
of the table. Uses Python indexing (so first column is `xpos=0`) of the table. Uses Python indexing (so first column is `xpos=0`)
Kwargs: Keyword args:
Other keywords as per `Cell.__init__`. Other keywords as per `Cell.__init__`.
""" """
@ -1622,7 +1622,7 @@ class EvTable(object):
input new row. If not given, will be added to the end of the table. input new row. If not given, will be added to the end of the table.
Uses Python indexing (so first row is `ypos=0`) Uses Python indexing (so first row is `ypos=0`)
Kwargs: Keyword args:
Other keywords are as per `EvCell.__init__`. Other keywords are as per `EvCell.__init__`.
""" """
@ -1661,7 +1661,7 @@ class EvTable(object):
""" """
Force a re-shape of the entire table. Force a re-shape of the entire table.
Kwargs: Keyword args:
Table options as per `EvTable.__init__`. Table options as per `EvTable.__init__`.
""" """
@ -1697,7 +1697,7 @@ class EvTable(object):
index (int): Which column to reformat. The column index is index (int): Which column to reformat. The column index is
given from 0 to Ncolumns-1. given from 0 to Ncolumns-1.
Kwargs: Keyword args:
Column options as per `EvCell.__init__`. Column options as per `EvCell.__init__`.
Raises: Raises:

View file

@ -81,7 +81,7 @@ def pad(*args, **kwargs):
align (str, optional): Alignment of padding; one of 'c', 'l' or 'r'. align (str, optional): Alignment of padding; one of 'c', 'l' or 'r'.
fillchar (str, optional): Character used for padding. Defaults to a space. fillchar (str, optional): Character used for padding. Defaults to a space.
Kwargs: Keyword args:
session (Session): Session performing the pad. session (Session): Session performing the pad.
Example: Example:
@ -111,7 +111,7 @@ def crop(*args, **kwargs):
crop in characters. crop in characters.
suffix (str, optional): End string to mark the fact that a part suffix (str, optional): End string to mark the fact that a part
of the string was cropped. Defaults to `[...]`. of the string was cropped. Defaults to `[...]`.
Kwargs: Keyword args:
session (Session): Session performing the crop. session (Session): Session performing the crop.
Example: Example:
@ -136,7 +136,7 @@ def space(*args, **kwargs):
Args: Args:
spaces (int, optional): The number of spaces to insert. spaces (int, optional): The number of spaces to insert.
Kwargs: Keyword args:
session (Session): Session performing the crop. session (Session): Session performing the crop.
Example: Example:
@ -159,7 +159,7 @@ def clr(*args, **kwargs):
text (str, optional): Text text (str, optional): Text
endclr (str, optional): The color to use at the end of the string. Defaults endclr (str, optional): The color to use at the end of the string. Defaults
to `|n` (reset-color). to `|n` (reset-color).
Kwargs: Keyword args:
session (Session): Session object triggering inlinefunc. session (Session): Session object triggering inlinefunc.
Example: Example:
@ -322,7 +322,7 @@ def parse_inlinefunc(string, strip=False, available_funcs=None, stacktrace=False
available_funcs (dict, optional): Define an alternative source of functions to parse for. available_funcs (dict, optional): Define an alternative source of functions to parse for.
If unset, use the functions found through `settings.INLINEFUNC_MODULES`. If unset, use the functions found through `settings.INLINEFUNC_MODULES`.
stacktrace (bool, optional): If set, print the stacktrace to log. stacktrace (bool, optional): If set, print the stacktrace to log.
Kwargs: Keyword args:
session (Session): This is sent to this function by Evennia when triggering session (Session): This is sent to this function by Evennia when triggering
it. It is passed to the inlinefunc. it. It is passed to the inlinefunc.
kwargs (any): All other kwargs are also passed on to the inlinefunc. kwargs (any): All other kwargs are also passed on to the inlinefunc.

View file

@ -113,7 +113,7 @@ class BaseOption(object):
where kwargs are a combination of those passed into this function and the where kwargs are a combination of those passed into this function and the
ones specified by the OptionHandler. ones specified by the OptionHandler.
Kwargs: Keyword args:
any (any): Not used by default. These are passed in from self.set any (any): Not used by default. These are passed in from self.set
and allows the option to let the caller customize saving by and allows the option to let the caller customize saving by
overriding or extend the default save kwargs overriding or extend the default save kwargs
@ -173,7 +173,7 @@ class BaseOption(object):
""" """
Renders the Option's value as something pretty to look at. Renders the Option's value as something pretty to look at.
Kwargs: Keyword args:
any (any): These are options passed by the caller to potentially any (any): These are options passed by the caller to potentially
customize display dynamically. customize display dynamically.

View file

@ -354,18 +354,18 @@ def list_to_string(inlist, endsep="and", addquote=False):
values with double quotes. values with double quotes.
Returns: Returns:
liststr (str): The list represented as a string. str: The list represented as a string.
Example: Examples:
```python ```python
# no endsep: >>> list_to_string([1,2,3], endsep='')
[1,2,3] -> '1, 2, 3' '1, 2, 3'
# with endsep=='and': >>> list_to_string([1,2,3], ensdep='and')
[1,2,3] -> '1, 2 and 3' '1, 2 and 3'
# with addquote and endsep >>> list_to_string([1,2,3], endsep='and', addquote=True)
[1,2,3] -> '"1", "2" and "3"' '"1", "2" and "3"'
``` ```
""" """
if not endsep: if not endsep:
@ -1656,18 +1656,17 @@ def format_table(table, extra_space=1):
function can be useful when the number of columns and rows are function can be useful when the number of columns and rows are
unknown and must be calculated on the fly. unknown and must be calculated on the fly.
Example: Examples: ::
```python ftable = format_table([[1,2,3], [4,5,6]])
ftable = format_table([[...], [...], ...]) string = ""
for ir, row in enumarate(ftable): for ir, row in enumarate(ftable):
if ir == 0: if ir == 0:
# make first row white # make first row white
string += "\n|w" + ""join(row) + "|n" string += "\\n|w" + "".join(row) + "|n"
else: else:
string += "\n" + "".join(row) string += "\\n" + "".join(row)
print string print(string)
```
""" """
@ -1705,13 +1704,13 @@ def percent(value, minval, maxval, formatting="{:3.1f}%"):
str or float: The formatted value or the raw percentage as a float. str or float: The formatted value or the raw percentage as a float.
Notes: Notes:
We try to handle a weird interval gracefully. We try to handle a weird interval gracefully.
- If either maxval or minval is None (open interval), we (aribtrarily) assume 100%. - If either maxval or minval is None (open interval), we (aribtrarily) assume 100%.
- If minval > maxval, we return 0%. - If minval > maxval, we return 0%.
- If minval == maxval == value we are looking at a single value match - If minval == maxval == value we are looking at a single value match and return 100%.
and return 100%.
- If minval == maxval != value we return 0%. - If minval == maxval != value we return 0%.
- If value not in [minval..maxval], we set value to the closest - If value not in [minval..maxval], we set value to the closest
boundary, so the result will be 0% or 100%, respectively. boundary, so the result will be 0% or 100%, respectively.
""" """
result = None result = None
@ -2244,7 +2243,7 @@ def interactive(func):
function has no arg or kwarg named 'caller'. function has no arg or kwarg named 'caller'.
ValueError: If passing non int/float to yield using for pausing. ValueError: If passing non int/float to yield using for pausing.
Example: Examples:
```python ```python
@interactive @interactive

View file

@ -145,7 +145,7 @@ class EvenniaIndexView(TemplateView):
You can do whatever you want to it, but it must be returned at the end You can do whatever you want to it, but it must be returned at the end
of this method. of this method.
Kwargs: Keyword args:
any (any): Passed through. any (any): Passed through.
Returns: Returns: