From a6d08022025f2e986ee7bb25506ed6819c485b71 Mon Sep 17 00:00:00 2001 From: Tehom Date: Tue, 19 Jun 2018 04:12:46 -0400 Subject: [PATCH 1/5] Move query/unpickling out of loop for mutelist. --- evennia/comms/comms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evennia/comms/comms.py b/evennia/comms/comms.py index e40de664d1..32ea2731a1 100644 --- a/evennia/comms/comms.py +++ b/evennia/comms/comms.py @@ -91,7 +91,8 @@ class DefaultChannel(with_metaclass(TypeclassBase, ChannelDB)): @property def wholist(self): subs = self.subscriptions.all() - listening = [ob for ob in subs if ob.is_connected and ob not in self.mutelist] + muted = list(self.mutelist) + listening = [ob for ob in subs if ob.is_connected and ob not in muted] if subs: # display listening subscribers in bold string = ", ".join([account.key if account not in listening else "|w%s|n" % account.key for account in subs]) From df866fb3f3f8c8efedb2290118dea2094f2f7fa3 Mon Sep 17 00:00:00 2001 From: Tehom Date: Thu, 28 Jun 2018 08:23:52 -0400 Subject: [PATCH 2/5] Add annotate method to TypedManager to filter by typeclass appropriately. --- evennia/typeclasses/managers.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/evennia/typeclasses/managers.py b/evennia/typeclasses/managers.py index e6ef778eb8..d6a08de16d 100644 --- a/evennia/typeclasses/managers.py +++ b/evennia/typeclasses/managers.py @@ -619,6 +619,18 @@ class TypeclassManager(TypedObjectManager): """ return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).count() + def annotate(self, *args, **kwargs): + """ + Overload annotate method to first call .all() to filter on typeclass before annotating. + Args: + *args (any): Positional arguments passed along to queryset annotate method. + **kwargs (any): Keyword arguments passed along to queryset annotate method. + + Returns: + Annotated queryset. + """ + return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).annotate(*args, **kwargs) + def _get_subclasses(self, cls): """ Recursively get all subclasses to a class. From 2cf8f3a97b0f371629940d2189796aa1c1738202 Mon Sep 17 00:00:00 2001 From: Tehom Date: Sat, 30 Jun 2018 02:31:47 -0400 Subject: [PATCH 3/5] Add on missing values and values_list methods while we're at it, for the same reasons. --- evennia/typeclasses/managers.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/evennia/typeclasses/managers.py b/evennia/typeclasses/managers.py index d6a08de16d..be9a6dd2c4 100644 --- a/evennia/typeclasses/managers.py +++ b/evennia/typeclasses/managers.py @@ -621,7 +621,7 @@ class TypeclassManager(TypedObjectManager): def annotate(self, *args, **kwargs): """ - Overload annotate method to first call .all() to filter on typeclass before annotating. + Overload annotate method to filter on typeclass before annotating. Args: *args (any): Positional arguments passed along to queryset annotate method. **kwargs (any): Keyword arguments passed along to queryset annotate method. @@ -631,6 +631,30 @@ class TypeclassManager(TypedObjectManager): """ return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).annotate(*args, **kwargs) + def values(self, *args, **kwargs): + """ + Overload values method to filter on typeclass first. + Args: + *args (any): Positional arguments passed along to values method. + **kwargs (any): Keyword arguments passed along to values method. + + Returns: + Queryset of values dictionaries, just filtered by typeclass first. + """ + return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).values(*args, **kwargs) + + def values_list(self, *args, **kwargs): + """ + Overload values method to filter on typeclass first. + Args: + *args (any): Positional arguments passed along to values_list method. + **kwargs (any): Keyword arguments passed along to values_list method. + + Returns: + Queryset of value_list tuples, just filtered by typeclass first. + """ + return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).values_list(*args, **kwargs) + def _get_subclasses(self, cls): """ Recursively get all subclasses to a class. From 040a94b1ee9fe8f7a8510276a29df4d788081fca Mon Sep 17 00:00:00 2001 From: Jerry Aldrich Date: Mon, 9 Jul 2018 08:33:47 -0700 Subject: [PATCH 4/5] Add space to the tutorial's CrumblingWall message Signed-off-by: Jerry Aldrich --- evennia/contrib/tutorial_world/objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evennia/contrib/tutorial_world/objects.py b/evennia/contrib/tutorial_world/objects.py index b260770577..0561f98d03 100644 --- a/evennia/contrib/tutorial_world/objects.py +++ b/evennia/contrib/tutorial_world/objects.py @@ -674,7 +674,7 @@ class CrumblingWall(TutorialObject, DefaultExit): # we found the button by moving the roots result = ["Having moved all the roots aside, you find that the center of the wall, " "previously hidden by the vegetation, hid a curious square depression. It was maybe once " - "concealed and made to look a part of the wall, but with the crumbling of stone around it," + "concealed and made to look a part of the wall, but with the crumbling of stone around it, " "it's now easily identifiable as some sort of button."] elif self.db.exit_open: # we pressed the button; the exit is open From 37e2e309efc16aa67f44c449adaa6b188b24a2d4 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 21 Jul 2018 14:13:58 +0200 Subject: [PATCH 5/5] Fix to redirect default at_first_login msg to right session --- evennia/accounts/accounts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evennia/accounts/accounts.py b/evennia/accounts/accounts.py index fe7693cce0..b32c3a31cb 100644 --- a/evennia/accounts/accounts.py +++ b/evennia/accounts/accounts.py @@ -777,7 +777,7 @@ class DefaultAccount(with_metaclass(TypeclassBase, AccountDB)): # any was deleted in the interim. self.db._playable_characters = [char for char in self.db._playable_characters if char] self.msg(self.at_look(target=self.db._playable_characters, - session=session)) + session=session), session=session) def at_failed_login(self, session, **kwargs): """