From d00ed3f82af2cd17da1a468edd88e82b6f2a3157 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 19 Jan 2022 23:01:54 +0100 Subject: [PATCH] Further doc cleanup --- docs/source/Contribs/Contrib-Cooldowns.md | 4 ++-- docs/source/Contribs/Contrib-Overview.md | 2 +- evennia/__init__.py | 3 --- evennia/prototypes/spawner.py | 8 ++++---- evennia/utils/create.py | 2 +- evennia/utils/search.py | 2 +- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/docs/source/Contribs/Contrib-Cooldowns.md b/docs/source/Contribs/Contrib-Cooldowns.md index 794af0b009..3e17ad926a 100644 --- a/docs/source/Contribs/Contrib-Cooldowns.md +++ b/docs/source/Contribs/Contrib-Cooldowns.md @@ -2,7 +2,7 @@ Contribution by owllex, 2021 -Cooldowns are used modelling rate-limited actions, like how often a +Cooldowns are used to model rate-limited actions, like how often a character can perform a given action; until a certain time has passed their command can not be used again. This contrib provides a simple cooldown handler that can be attached to any typeclass. A cooldown is a lightweight persistent @@ -30,7 +30,7 @@ customize this if desired by passing a different value for the `db_attribute` parameter. ```python -from evennia.game_systems.contrib.cooldowns import Cooldownhandler +from evennia.contrib.game_systems.cooldowns import Cooldownhandler from evennia.utils.utils import lazy_property @lazy_property diff --git a/docs/source/Contribs/Contrib-Overview.md b/docs/source/Contribs/Contrib-Overview.md index da12d1854f..b923fc41e9 100644 --- a/docs/source/Contribs/Contrib-Overview.md +++ b/docs/source/Contribs/Contrib-Overview.md @@ -213,7 +213,7 @@ look of these clothes are appended to the character's description when worn. _Contribution by owllex, 2021_ -Cooldowns are used modelling rate-limited actions, like how often a +Cooldowns are used to model rate-limited actions, like how often a character can perform a given action; until a certain time has passed their command can not be used again. This contrib provides a simple cooldown handler that can be attached to any typeclass. A cooldown is a lightweight persistent diff --git a/evennia/__init__.py b/evennia/__init__.py index eefba35d46..a75101be31 100644 --- a/evennia/__init__.py +++ b/evennia/__init__.py @@ -363,9 +363,6 @@ def _init(): # delayed starts - important so as to not back-access evennia before it has # finished initializing GLOBAL_SCRIPTS.start() - # from .prototypes import prototypes - # prototypes.load_module_prototypes() - # del prototypes def set_trace(term_size=(140, 80), debugger="auto"): diff --git a/evennia/prototypes/spawner.py b/evennia/prototypes/spawner.py index ce79d85c5e..7fa641c357 100644 --- a/evennia/prototypes/spawner.py +++ b/evennia/prototypes/spawner.py @@ -241,15 +241,15 @@ def _get_prototype(inprot, protparents, uninherited=None, _workprot=None): # attrs, tags have internal structure that should be inherited separately new_prot["attrs"] = _inherit_attrs( - _workprot.get("attrs", {}), new_prot.get("attrs", {}) + _workprot.get("attrs", {}), new_prot.get("attrs", []) ) - new_prot["tags"] = _inherit_tags(_workprot.get("tags", {}), new_prot.get("tags", {})) + new_prot["tags"] = _inherit_tags(_workprot.get("tags", []), new_prot.get("tags", [])) _workprot.update(new_prot) # the inprot represents a higher level (a child prot), which should override parents - inprot["attrs"] = _inherit_attrs(_workprot.get("attrs", {}), inprot.get("attrs", {})) - inprot["tags"] = _inherit_tags(_workprot.get("tags", {}), inprot.get("tags", {})) + inprot["attrs"] = _inherit_attrs(_workprot.get("attrs", []), inprot.get("attrs", [])) + inprot["tags"] = _inherit_tags(_workprot.get("tags", []), inprot.get("tags", [])) _workprot.update(inprot) if uninherited: # put back the parts that should not be inherited diff --git a/evennia/utils/create.py b/evennia/utils/create.py index db45ff4421..7127d7e672 100644 --- a/evennia/utils/create.py +++ b/evennia/utils/create.py @@ -40,7 +40,7 @@ try: Tag = ContentType.objects.get(app_label="typeclasses", model="tag").model_class() except (OperationalError, ProgrammingError): # this is a fallback used during tests/doc building - print("Couldn't initialize create managers - db not set up.") + print("Database not available yet - using temporary fallback for create managers.") from evennia.objects.models import ObjectDB from evennia.accounts.models import AccountDB from evennia.scripts.models import ScriptDB diff --git a/evennia/utils/search.py b/evennia/utils/search.py index e5b8c7af2f..18929057f1 100644 --- a/evennia/utils/search.py +++ b/evennia/utils/search.py @@ -55,7 +55,7 @@ try: Tag = ContentType.objects.get(app_label="typeclasses", model="tag").model_class() except (OperationalError, ProgrammingError): # this is a fallback used during tests/doc building - print("Couldn't initialize search managers - db not set up.") + print("Database not available yet - using temporary fallback for search managers.") from evennia.objects.models import ObjectDB from evennia.accounts.models import AccountDB from evennia.scripts.models import ScriptDB