From 0b351cfa12fd09c9652f6ecc57f2c2d5a475784e Mon Sep 17 00:00:00 2001 From: ChrisLR Date: Sat, 3 Oct 2020 13:02:54 -0400 Subject: [PATCH] Renamed key to tag --- evennia/typeclasses/tags.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/evennia/typeclasses/tags.py b/evennia/typeclasses/tags.py index 0bb2e994e1..f3c3d6d15e 100644 --- a/evennia/typeclasses/tags.py +++ b/evennia/typeclasses/tags.py @@ -319,26 +319,26 @@ class TagHandler(object): getattr(self.obj, self._m2m_fieldname).add(tagobj) self._setcache(tagstr, category, tagobj) - def has(self, key=None, category=None, return_list=False): + def has(self, tag=None, category=None, return_list=False): """ Checks if the given Tag (or list of Tags) exists on the object. Args: - key (str or iterable): The Tag key or keys to check for. + tag (str or iterable): The Tag key or tags to check for. If `None`, search by category. category (str or None): Limit the check to Tags with this category (note, that `None` is the default category). Returns: has_tag (bool or list): If the Tag exists on this object or not. - If `key` was given as an iterable then the return is a list of booleans. + If `tag` was given as an iterable then the return is a list of booleans. """ ret = [] category = category.strip().lower() if category is not None else None - for key_str in make_iter(key): - key_str = key_str.strip().lower() - ret.extend(bool(tag) for tag in self._getcache(key_str, category)) + for tag_str in make_iter(tag): + tag_str = tag_str.strip().lower() + ret.extend(bool(tag) for tag in self._getcache(tag_str, category)) if return_list: return ret