From 7fed14d233e91a136d4318ec05d6fa2dde6758ed Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 10 Jul 2020 15:05:18 +0200 Subject: [PATCH] Rename docstring Kwargs to Keyword Args --- docs/source/Evennia-API.md | 1 + docs/source/conf.py | 2 +- evennia/__init__.py | 46 ++++++++----------- evennia/accounts/accounts.py | 22 ++++----- evennia/accounts/bots.py | 6 +-- evennia/commands/cmdhandler.py | 2 +- evennia/commands/command.py | 8 ++-- evennia/comms/comms.py | 2 +- evennia/contrib/building_menu.py | 2 +- evennia/contrib/clothing.py | 6 +-- evennia/contrib/custom_gametime.py | 4 +- evennia/contrib/evscaperoom/state.py | 2 +- evennia/contrib/evscaperoom/utils.py | 4 +- .../contrib/ingame_python/callbackhandler.py | 2 +- evennia/contrib/ingame_python/eventfuncs.py | 2 +- evennia/contrib/ingame_python/scripts.py | 2 +- evennia/contrib/ingame_python/typeclasses.py | 4 +- evennia/contrib/rpsystem.py | 6 +-- evennia/contrib/security/auditing/server.py | 6 +-- evennia/contrib/turnbattle/tb_basic.py | 2 +- evennia/contrib/turnbattle/tb_equip.py | 2 +- evennia/contrib/turnbattle/tb_items.py | 2 +- evennia/contrib/turnbattle/tb_magic.py | 2 +- evennia/contrib/turnbattle/tb_range.py | 4 +- evennia/contrib/unixcommand.py | 2 +- .../game_template/server/conf/at_search.py | 2 +- evennia/objects/objects.py | 36 +++++++-------- evennia/prototypes/menus.py | 12 ++--- evennia/prototypes/prototypes.py | 4 +- evennia/prototypes/spawner.py | 2 +- evennia/scripts/monitorhandler.py | 2 +- evennia/scripts/taskhandler.py | 2 +- evennia/scripts/tickerhandler.py | 2 +- evennia/server/connection_wizard.py | 6 +-- evennia/server/evennia_launcher.py | 2 +- evennia/server/inputfuncs.py | 14 +++--- evennia/server/portal/grapevine.py | 2 +- evennia/server/portal/irc.py | 6 +-- evennia/server/portal/portalsessionhandler.py | 4 +- evennia/server/portal/rss.py | 2 +- evennia/server/portal/ssh.py | 24 +++++----- evennia/server/portal/telnet.py | 6 +-- evennia/server/portal/webclient.py | 4 +- evennia/server/portal/webclient_ajax.py | 8 ++-- evennia/server/serversession.py | 10 ++-- evennia/server/session.py | 4 +- evennia/server/sessionhandler.py | 2 +- evennia/server/throttle.py | 2 +- evennia/typeclasses/attributes.py | 2 +- evennia/typeclasses/managers.py | 10 ++-- evennia/typeclasses/models.py | 4 +- evennia/utils/create.py | 8 ++-- evennia/utils/evform.py | 2 +- evennia/utils/evtable.py | 32 ++++++------- evennia/utils/inlinefuncs.py | 10 ++-- evennia/utils/optionclasses.py | 4 +- evennia/utils/utils.py | 41 ++++++++--------- evennia/web/website/views.py | 2 +- 58 files changed, 203 insertions(+), 213 deletions(-) diff --git a/docs/source/Evennia-API.md b/docs/source/Evennia-API.md index c60315af65..c861a378df 100644 --- a/docs/source/Evennia-API.md +++ b/docs/source/Evennia-API.md @@ -1,5 +1,6 @@ # API +- [evennia](api:evennia) - root of API - [evennia.accounts](api:evennia.accounts) - the out-of-character entity representing players - [evennia.commands](api:evennia.commands) - all inputs. Also includes default commands - [evennia.comms](api:evennia.comms) - in-game channels and messaging diff --git a/docs/source/conf.py b/docs/source/conf.py index d20441116d..e1784b3c53 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -211,7 +211,7 @@ if not _no_autodoc: if _no_autodoc: exclude_patterns = ["api/*"] else: - exclude_patterns = ["api/*migrations.rst"] + exclude_patterns = ["api/*migrations.rst", "api/*tests.rst"] autodoc_default_options = { "members": True, diff --git a/evennia/__init__.py b/evennia/__init__.py index d05d369383..20ce85e7c3 100644 --- a/evennia/__init__.py +++ b/evennia/__init__.py @@ -5,7 +5,7 @@ This is the main top-level API for Evennia. You can explore the evennia library by accessing evennia. directly. From inside the game you can read 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- 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 = """ -|cEvennia|n 'flat' API (use |wevennia..__doc__|n to read doc-strings - and |wdict(evennia.component)|n or - |wevennia.component.__dict__ to see contents) -|cTypeclass-bases:|n |cDatabase models|n: - DefaultAccount DefaultObject AccountDB ObjectDB - 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 """ +Evennia MU* creation system. + +Online manual and API docs are found at http://www.evennia.com. + +Flat-API shortcut names: +{} +""" # Delayed loading of properties @@ -248,10 +234,6 @@ def _init(): from .utils.containers import GLOBAL_SCRIPTS from .utils.containers import OPTION_CLASSES - # initialize the doc string - global __doc__ - __doc__ = ansi.parse_ansi(DOCSTRING) - # API containers class _EvContainer(object): @@ -461,9 +443,17 @@ def set_trace(term_size=(140, 80), debugger="auto"): dbg = pdb.Pdb(stdout=sys.__stdout__) try: - # Start debugger, forcing it up one stack frame (otherwise `set_trace` will start debugger - # this point, not the actual code location) + # Start debugger, forcing it up one stack frame (otherwise `set_trace` + # will start debugger this point, not the actual code location) dbg.set_trace(sys._getframe().f_back) except Exception: # Stopped at breakpoint. Press 'n' to continue into the code. 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", ))) diff --git a/evennia/accounts/accounts.py b/evennia/accounts/accounts.py index 94502427db..c765c83a5a 100644 --- a/evennia/accounts/accounts.py +++ b/evennia/accounts/accounts.py @@ -410,7 +410,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase): """ Checks if a given username or IP is banned. - Kwargs: + Keyword args: ip (str, optional): IP address. username (str, optional): Username. @@ -481,7 +481,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase): password (str): Password of account ip (str, optional): IP address of client - Kwargs: + Keyword args: session (Session, optional): Session requesting authentication Returns: @@ -611,7 +611,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase): Args: password (str): Password to validate - Kwargs: + Keyword args: account (DefaultAccount, optional): Account object to validate the password for. Optional, but Django includes some validators to 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 appropriate default channels. - Kwargs: + Keyword args: username (str): Username of Account owner password (str): Password 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 MULTISESSION_MODE. options (list): Protocol-specific options. Passed on to the protocol. - Kwargs: + Keyword args: 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 for the command-send - Kwargs: + Keyword args: kwargs (any): Other keyword arguments will be added to the found command object instance as variables before it 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 lock bypassing. Be careful with this one. - Kwargs: + Keyword args: kwargs (any): Passed to the at_access hook along with the result. Returns: @@ -1143,7 +1143,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase): check. access_type (str): The type of access checked. - Kwargs: + Keyword args: kwargs (any): These are passed on from the access check and can be used to relay custom instructions from the check mechanism. @@ -1345,7 +1345,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase): text (str, optional): The message received. from_obj (any, optional): The object sending the message. - Kwargs: + Keyword args: This includes any keywords sent to the `msg` method. Returns: @@ -1367,7 +1367,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase): text (str, optional): Text to send. to_obj (any, optional): The object to send to. - Kwargs: + Keyword args: Keywords passed from msg() Notes: @@ -1526,7 +1526,7 @@ class DefaultGuest(DefaultAccount): """ Gets or creates a Guest account object. - Kwargs: + Keyword args: ip (str, optional): IP address of requestor; used for ban checking, throttling and logging diff --git a/evennia/accounts/bots.py b/evennia/accounts/bots.py index 420d96053d..81ebb1252c 100644 --- a/evennia/accounts/bots.py +++ b/evennia/accounts/bots.py @@ -278,7 +278,7 @@ class IRCBot(Bot): Args: text (str, optional): Incoming text from channel. - Kwargs: + Keyword args: options (dict): Options dict with the following allowed keys: - from_channel (str): dbid of a channel this text originated from. - from_obj (list): list of objects sending this text. @@ -308,7 +308,7 @@ class IRCBot(Bot): session (Session, optional): Session responsible for this command. Note that this is the bot. txt (str, optional): Command string. - Kwargs: + Keyword args: user (str): The name of the user who sent the message. channel (str): The name of channel the message was sent to. type (str): Nature of message. Either 'msg', 'action', 'nicklist' @@ -518,7 +518,7 @@ class GrapevineBot(Bot): Args: text (str, optional): Incoming text from channel. - Kwargs: + Keyword args: options (dict): Options dict with the following allowed keys: - from_channel (str): dbid of a channel this text originated from. - from_obj (list): list of objects sending this text. diff --git a/evennia/commands/cmdhandler.py b/evennia/commands/cmdhandler.py index 8ae1a7f285..41337433d2 100644 --- a/evennia/commands/cmdhandler.py +++ b/evennia/commands/cmdhandler.py @@ -540,7 +540,7 @@ def cmdhandler( is made available as `self.cmdstring` when the Command runs. 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 retrieved command object *before* it is executed. This is unused in default Evennia but may be used by code to set custom flags or diff --git a/evennia/commands/command.py b/evennia/commands/command.py index fa2c3265b4..c195ab39d3 100644 --- a/evennia/commands/command.py +++ b/evennia/commands/command.py @@ -349,7 +349,7 @@ class Command(object, metaclass=CommandMeta): session (Session, optional): Supply data only to a unique session (ignores the value of `self.msg_all_sessions`). - Kwargs: + Keyword args: options (dict): Options to the protocol. any (any): All other keywords are interpreted as th 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. If not given, self.caller will be used. - 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 @@ -523,7 +523,7 @@ Command {self} has no defined `func()` - showing on-command variables: Args: *args (str): Column headers. If not colored explicitly, these will get colors from user options. - Kwargs: + Keyword args: any (str, int or dict): EvTable options, including, optionally a `table` dict detailing the contents of the table. 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. - Kwargs: + Keyword args: header_text (str): Text to include in header. fill_character (str): This single character will be used to fill the width of the display. diff --git a/evennia/comms/comms.py b/evennia/comms/comms.py index 430478828c..8c3e70c395 100644 --- a/evennia/comms/comms.py +++ b/evennia/comms/comms.py @@ -253,7 +253,7 @@ class DefaultChannel(ChannelDB, metaclass=TypeclassBase): key (str): This must be unique. account (Account): Account to attribute this object to. - Kwargs: + Keyword args: aliases (list of str): List of alternative (likely shorter) keynames. description (str): A description of the channel, for use in listings. locks (str): Lockstring. diff --git a/evennia/contrib/building_menu.py b/evennia/contrib/building_menu.py index ea56981d48..4e99f8f166 100644 --- a/evennia/contrib/building_menu.py +++ b/evennia/contrib/building_menu.py @@ -175,7 +175,7 @@ def _call_or_get(value, menu=None, choice=None, string=None, obj=None, caller=No Args: 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 if it is a callable. choice (Choice, optional): the choice to pass to value if a callable. diff --git a/evennia/contrib/clothing.py b/evennia/contrib/clothing.py index 73bd9c20a7..a91a23a349 100644 --- a/evennia/contrib/clothing.py +++ b/evennia/contrib/clothing.py @@ -160,7 +160,7 @@ def get_worn_clothes(character, exclude_covered=False): Args: 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 clothing from the returned list. @@ -237,7 +237,7 @@ class Clothing(DefaultObject): wearer (obj): character object wearing this clothing object 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 Notes: @@ -276,7 +276,7 @@ class Clothing(DefaultObject): Args: wearer (obj): character object wearing this clothing object - Kwargs: + Keyword args: quiet (bool): If false, does not message the room """ self.db.worn = False diff --git a/evennia/contrib/custom_gametime.py b/evennia/contrib/custom_gametime.py index b94a308ced..f2bf7542d6 100644 --- a/evennia/contrib/custom_gametime.py +++ b/evennia/contrib/custom_gametime.py @@ -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 corresponds to (hint: Interval events deal with real life seconds). - Kwargs: + Keyword args: format (bool): Formatting the output. days, month etc (int): These are the names of time units that must 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 interesting than the other way around. - Kwargs: + Keyword args: times (int): The various components of the time. format (bool): Formatting the output. diff --git a/evennia/contrib/evscaperoom/state.py b/evennia/contrib/evscaperoom/state.py index b238643981..cf37b00895 100644 --- a/evennia/contrib/evscaperoom/state.py +++ b/evennia/contrib/evscaperoom/state.py @@ -219,7 +219,7 @@ class BaseState(object): """ 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 objects.py module. Otherwise, a full path or the actual class is needed (for custom state objects, just give the class directly). diff --git a/evennia/contrib/evscaperoom/utils.py b/evennia/contrib/evscaperoom/utils.py index 8dea6942af..fe2d2a22b2 100644 --- a/evennia/contrib/evscaperoom/utils.py +++ b/evennia/contrib/evscaperoom/utils.py @@ -27,7 +27,7 @@ def create_evscaperoom_object( Note that for the purpose of the Evscaperoom, we only allow one instance 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 objects.py module. Otherwise, a full path is needed. key (str): Name of object. @@ -69,7 +69,7 @@ def create_fantasy_word(length=5, capitalize=True): """ Create a random semi-pronouncable 'word'. - Kwargs: + Keyword args: length (int): The desired length of the 'word'. capitalize (bool): If the return should be capitalized or not Returns: diff --git a/evennia/contrib/ingame_python/callbackhandler.py b/evennia/contrib/ingame_python/callbackhandler.py index a7b020708a..a7eb1c89c7 100644 --- a/evennia/contrib/ingame_python/callbackhandler.py +++ b/evennia/contrib/ingame_python/callbackhandler.py @@ -155,7 +155,7 @@ class CallbackHandler(object): callback_name (str): the callback name to call. *args: additional variables for this callback. - Kwargs: + Keyword args: number (int, optional): call just a specific callback. parameters (str, optional): call a callback with parameters. locals (dict, optional): a locals replacement. diff --git a/evennia/contrib/ingame_python/eventfuncs.py b/evennia/contrib/ingame_python/eventfuncs.py index daa9185347..3185973aa7 100644 --- a/evennia/contrib/ingame_python/eventfuncs.py +++ b/evennia/contrib/ingame_python/eventfuncs.py @@ -28,7 +28,7 @@ def get(**kwargs): """ 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...). Returns: diff --git a/evennia/contrib/ingame_python/scripts.py b/evennia/contrib/ingame_python/scripts.py index 5c91600262..60a829a2c0 100644 --- a/evennia/contrib/ingame_python/scripts.py +++ b/evennia/contrib/ingame_python/scripts.py @@ -397,7 +397,7 @@ class EventHandler(DefaultScript): callback_name (str): the callback name to call. *args: additional variables for this callback. - Kwargs: + Keyword args: number (int, optional): call just a specific callback. parameters (str, optional): call a callback with parameters. locals (dict, optional): a locals replacement. diff --git a/evennia/contrib/ingame_python/typeclasses.py b/evennia/contrib/ingame_python/typeclasses.py index 6c3d2036fb..635faa5800 100644 --- a/evennia/contrib/ingame_python/typeclasses.py +++ b/evennia/contrib/ingame_python/typeclasses.py @@ -421,7 +421,7 @@ class EventCharacter(DefaultCharacter): Args: 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. This is sent by the whisper command by default. Other verbal commands could use this hook in similar @@ -477,7 +477,7 @@ class EventCharacter(DefaultCharacter): (by default only used by whispers). msg_receiver(str, optional): Specific message for receiver only. mapping (dict, optional): Additional mapping in messages. - Kwargs: + Keyword args: whisper (bool): If this is a whisper rather than a say. Kwargs can be used by other verbal commands in a similar way. diff --git a/evennia/contrib/rpsystem.py b/evennia/contrib/rpsystem.py index 4f68f0dc44..832f859514 100644 --- a/evennia/contrib/rpsystem.py +++ b/evennia/contrib/rpsystem.py @@ -1420,7 +1420,7 @@ class ContribRPObject(DefaultObject): looker (TypedObject): The object or account that is looking at/getting inforamtion for this object. - Kwargs: + Keyword args: pose (bool): Include the pose (if available) in the return. Returns: @@ -1508,7 +1508,7 @@ class ContribRPCharacter(DefaultCharacter, ContribRPObject): looker (TypedObject): The object or account that is looking at/getting inforamtion for this object. - Kwargs: + Keyword args: pose (bool): Include the pose (if available) in the return. Returns: @@ -1557,7 +1557,7 @@ class ContribRPCharacter(DefaultCharacter, ContribRPObject): Args: 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. """ diff --git a/evennia/contrib/security/auditing/server.py b/evennia/contrib/security/auditing/server.py index f7dd0c7a98..c4bb61857d 100644 --- a/evennia/contrib/security/auditing/server.py +++ b/evennia/contrib/security/auditing/server.py @@ -70,7 +70,7 @@ class AuditedServerSession(ServerSession): Extracts messages and system data from a Session object upon message send or receive. - Kwargs: + Keyword args: src (str): Source of data; 'client' or 'server'. Indicates direction. text (str or list): Client sends messages to server in the form of lists. Server sends messages to client as string. @@ -216,7 +216,7 @@ class AuditedServerSession(ServerSession): """ Generic hook for sending data out through the protocol. - Kwargs: + Keyword args: kwargs (any): Other data to the protocol. """ @@ -234,7 +234,7 @@ class AuditedServerSession(ServerSession): """ Hook for protocols to send incoming data to the engine. - Kwargs: + Keyword args: kwargs (any): Other data from the protocol. """ diff --git a/evennia/contrib/turnbattle/tb_basic.py b/evennia/contrib/turnbattle/tb_basic.py index 35c5bc130f..86d3bcf101 100644 --- a/evennia/contrib/turnbattle/tb_basic.py +++ b/evennia/contrib/turnbattle/tb_basic.py @@ -279,7 +279,7 @@ def spend_action(character, actions, action_name=None): character (obj): Character spending the action 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 combat to provided string """ diff --git a/evennia/contrib/turnbattle/tb_equip.py b/evennia/contrib/turnbattle/tb_equip.py index a789f4ccf1..ac597b7a9a 100644 --- a/evennia/contrib/turnbattle/tb_equip.py +++ b/evennia/contrib/turnbattle/tb_equip.py @@ -330,7 +330,7 @@ def spend_action(character, actions, action_name=None): character (obj): Character spending the action 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 combat to provided string """ diff --git a/evennia/contrib/turnbattle/tb_items.py b/evennia/contrib/turnbattle/tb_items.py index 1e6fce59f7..8a74c70d6a 100644 --- a/evennia/contrib/turnbattle/tb_items.py +++ b/evennia/contrib/turnbattle/tb_items.py @@ -348,7 +348,7 @@ def spend_action(character, actions, action_name=None): character (obj): Character spending the action 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 combat to provided string """ diff --git a/evennia/contrib/turnbattle/tb_magic.py b/evennia/contrib/turnbattle/tb_magic.py index ab9f094d26..0713e3a0cb 100644 --- a/evennia/contrib/turnbattle/tb_magic.py +++ b/evennia/contrib/turnbattle/tb_magic.py @@ -304,7 +304,7 @@ def spend_action(character, actions, action_name=None): character (obj): Character spending the action 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 combat to provided string """ diff --git a/evennia/contrib/turnbattle/tb_range.py b/evennia/contrib/turnbattle/tb_range.py index c0eca41487..4c50834c31 100644 --- a/evennia/contrib/turnbattle/tb_range.py +++ b/evennia/contrib/turnbattle/tb_range.py @@ -470,7 +470,7 @@ def spend_action(character, actions, action_name=None): character (obj): Character spending the action 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 combat to provided string """ @@ -642,7 +642,7 @@ class TBRangeTurnHandler(DefaultScript): Args: 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. add_distance (int): Distance to put between to_init object and anchor object. diff --git a/evennia/contrib/unixcommand.py b/evennia/contrib/unixcommand.py index 46d38c1589..615cee7c84 100644 --- a/evennia/contrib/unixcommand.py +++ b/evennia/contrib/unixcommand.py @@ -98,7 +98,7 @@ class UnixCommandParser(argparse.ArgumentParser): epilog (str): the epilog to show below options. command (Command): the command calling the parser. - Kwargs: + Keyword args: Additional keyword arguments are directly sent to `argparse.ArgumentParser`. You will find them on the [parser's documentation](https://docs.python.org/2/library/argparse.html). diff --git a/evennia/game_template/server/conf/at_search.py b/evennia/game_template/server/conf/at_search.py index 09828944b7..bbe6d63fcb 100644 --- a/evennia/game_template/server/conf/at_search.py +++ b/evennia/game_template/server/conf/at_search.py @@ -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 on errors. - Kwargs: + Keyword args: nofound_string (str): Replacement string to echo on a notfound error. multimatch_string (str): Replacement string to echo on a multimatch error. diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py index a9b0bd5fa8..2cb67f6120 100644 --- a/evennia/objects/objects.py +++ b/evennia/objects/objects.py @@ -337,7 +337,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): Args: count (int): Number of objects of this type 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. Returns: singular (str): The singular form to display. @@ -559,7 +559,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): session (Session, optional): Session to return results to - 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 @@ -605,7 +605,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): depends on the MULTISESSION_MODE. options (dict, optional): Message-specific option-value pairs. These will be applied at the protocol level. - Kwargs: + Keyword args: any (string or tuples): All kwarg keys not listed above will be treated as send-command names and their arguments (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 function on. - Kwargs: + Keyword args: Keyword arguments will be passed to the function for all objects. """ contents = self.contents @@ -688,7 +688,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): for every looker in contents that receives the message. This allows for every object to potentially get its own customized string. - Kwargs: + Keyword args: Keyword arguments will be passed on to `obj.msg()` for all 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 as can be done. - Kwargs: + Keyword args: Passed on to announce_move_to and announce_move_from hooks. Returns: @@ -937,7 +937,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): key (str): Name of the new object. account (Account): Account to attribute this object to. - Kwargs: + Keyword args: description (str): Brief description for this object. 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 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. """ @@ -1262,7 +1262,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): place to do it. This is called also if the object currently have no cmdsets. - Kwargs: + Keyword args: caller (Session, Object or Account): The caller requesting this cmdset. @@ -1364,7 +1364,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): accessing_obj (Object or Account): The entity trying to gain access. access_type (str): The type of access that was requested. - Kwargs: + Keyword args: Not used by default, added for possible expandability in a game. @@ -1615,7 +1615,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): text (str, optional): The message received. from_obj (any, optional): The object sending the message. - Kwargs: + Keyword args: This includes any keywords sent to the `msg` method. Returns: @@ -1637,7 +1637,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): text (str, optional): Text to send. to_obj (any, optional): The object to send to. - Kwargs: + Keyword args: Keywords passed from msg() Notes: @@ -1879,7 +1879,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): Args: 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. This is sent by the whisper command by default. Other verbal commands could use this hook in similar @@ -1919,7 +1919,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): (by default only used by whispers). msg_receivers(str): Specific message to pass to the receiver(s). This will parsed with the {receiver} placeholder replaced with the given receiver. - Kwargs: + Keyword args: whisper (bool): If this is a whisper rather than a say. Kwargs can be used by other verbal commands in a similar way. 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 change the default lockset and skip creator attribution. - Kwargs: + Keyword args: description (str): Brief description for this object. ip (str): IP address of creator (for object auditing). 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. account (obj): Account to associate this Room with. - Kwargs: + Keyword args: description (str): Brief description for this object. 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. dest (Room): The room to which this exit should go. - Kwargs: + Keyword args: description (str): Brief description for this object. 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 has no cmdsets. - Kwargs: + Keyword args: force_init (bool): If `True`, force a re-build of the cmdset (for example to update aliases). diff --git a/evennia/prototypes/menus.py b/evennia/prototypes/menus.py index 94b331a303..ff668b85f3 100644 --- a/evennia/prototypes/menus.py +++ b/evennia/prototypes/menus.py @@ -130,7 +130,7 @@ def _set_property(caller, raw_string, **kwargs): caller (Object, Account): The user of the wizard. 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 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 @@ -297,7 +297,7 @@ def _format_list_actions(*args, **kwargs): Args: actions (str): Available actions. The first letter of the action name will be assumed to be a shortcut. - Kwargs: + Keyword args: prefix (str): Default prefix to use. Returns: string (str): Formatted footer for adding to the node text. @@ -1175,7 +1175,7 @@ def _add_attr(caller, attr_string, **kwargs): attr = value attr;category = value attr;category;lockstring = value - Kwargs: + Keyword args: delete (str): If this is set, attr_string is considered the name of the attribute to delete and no further parsing happens. @@ -1362,7 +1362,7 @@ def _add_tag(caller, tag_string, **kwargs): tagname;category tagname;category;data - Kwargs: + Keyword args: delete (str): If this is set, tag_string is considered the name of the tag to delete. @@ -1911,7 +1911,7 @@ def _add_prototype_tag(caller, tag_string, **kwargs): caller (Object): Caller of menu. tag_string (str): Input from user - only tagname - Kwargs: + Keyword args: delete (str): If this is set, tag_string is considered 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`. minimal (bool, optional): Don't show KEEPs. - Kwargs: + Keyword args: any (any): Forwarded into the generated options as arguments to the callable. Returns: diff --git a/evennia/prototypes/prototypes.py b/evennia/prototypes/prototypes.py index 98cfa9505c..9da1fb1b65 100644 --- a/evennia/prototypes/prototypes.py +++ b/evennia/prototypes/prototypes.py @@ -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. - Kwargs: + Keyword args: key (str): An exact or partial key to query for. tags (str or list): Tag key or keys to query for. These 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. 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. 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. diff --git a/evennia/prototypes/spawner.py b/evennia/prototypes/spawner.py index ab401af5bb..040619d1a5 100644 --- a/evennia/prototypes/spawner.py +++ b/evennia/prototypes/spawner.py @@ -841,7 +841,7 @@ def spawn(*prototypes, **kwargs): prototypes (str or dict): Each argument should either be a prototype_key (will be used to find the prototype) or a full prototype dictionary. These will be batched-spawned as one object each. - Kwargs: + Keyword args: prototype_modules (str or list): A python-path to a prototype module, or a list of such paths. These will be used to build the global protparents dictionary accessible by the input diff --git a/evennia/scripts/monitorhandler.py b/evennia/scripts/monitorhandler.py index e47e9d1546..765e52e8c5 100644 --- a/evennia/scripts/monitorhandler.py +++ b/evennia/scripts/monitorhandler.py @@ -125,7 +125,7 @@ class MonitorHandler(object): persistent (bool, optional): If False, the monitor will survive a server reload but not a cold restart. This is default. - Kwargs: + Keyword args: session (Session): If this keyword is given, the monitorhandler will correctly analyze it and remove the monitor if after a reload/reboot the session is no longer valid. diff --git a/evennia/scripts/taskhandler.py b/evennia/scripts/taskhandler.py index 4ec3f89808..f439bebc32 100644 --- a/evennia/scripts/taskhandler.py +++ b/evennia/scripts/taskhandler.py @@ -100,7 +100,7 @@ class TaskHandler(object): callback (function or instance method): the callback itself any (any): any additional positional arguments to send to the callback - Kwargs: + Keyword args: persistent (bool, optional): persist the task (store it). any (any): additional keyword arguments to send to the callback diff --git a/evennia/scripts/tickerhandler.py b/evennia/scripts/tickerhandler.py index c17d64d7d5..14e7c6a3a1 100644 --- a/evennia/scripts/tickerhandler.py +++ b/evennia/scripts/tickerhandler.py @@ -183,7 +183,7 @@ class Ticker(object): store_key (str): Unique storage hash for this ticker subscription. args (any, optional): Arguments to call the hook method with. - Kwargs: + Keyword args: _start_delay (int): If set, this will be used to delay the start of the trigger instead of `interval`. diff --git a/evennia/server/connection_wizard.py b/evennia/server/connection_wizard.py index 8fe0090f63..925edf46a6 100644 --- a/evennia/server/connection_wizard.py +++ b/evennia/server/connection_wizard.py @@ -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 diff --git a/evennia/server/evennia_launcher.py b/evennia/server/evennia_launcher.py index 7a00f8e07d..c43ec57c47 100644 --- a/evennia/server/evennia_launcher.py +++ b/evennia/server/evennia_launcher.py @@ -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. """ diff --git a/evennia/server/inputfuncs.py b/evennia/server/inputfuncs.py index 24f74af19f..7cca7a5b59 100644 --- a/evennia/server/inputfuncs.py +++ b/evennia/server/inputfuncs.py @@ -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: