From 6eebfcc6d5885479d2b907ef2b228acdba140856 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 9 Nov 2017 10:00:11 +0000 Subject: [PATCH] Switch actors to new-style elements Actor elements created for avatars now follow the new data model. --- mudpy/misc.py | 12 ++++-------- mudpy/tests/selftest.py | 6 +++--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/mudpy/misc.py b/mudpy/misc.py index c3e1940..231858a 100644 --- a/mudpy/misc.py +++ b/mudpy/misc.py @@ -944,16 +944,12 @@ class User: def new_avatar(self): """Instantiate a new, unconfigured avatar for this user.""" counter = 0 - while "avatar:" + self.account.get("name") + ":" + str( - counter - ) in universe.categories.get("actor", {}).keys(): + while ("avatar_%s_%s" % (self.account.get("name"), counter) + in universe.categories.get("actor", {}).keys()): counter += 1 self.avatar = Element( - "actor:avatar:" + self.account.get("name") + ":" + str( - counter - ), - universe, old_style=True - ) + "actor.avatar_%s_%s" % (self.account.get("name"), counter), + universe) self.avatar.append("inherit", "archetype:avatar") self.account.append("avatars", self.avatar.key) diff --git a/mudpy/tests/selftest.py b/mudpy/tests/selftest.py index 02d98a5..5adc43c 100644 --- a/mudpy/tests/selftest.py +++ b/mudpy/tests/selftest.py @@ -162,7 +162,7 @@ test_reload = ( ) test_set_facet = ( - (2, "> ", "set actor:avatar:admin:0 gender female"), + (2, "> ", "set actor.avatar_admin_0 gender female"), (2, r'You have successfully \(re\)set the "gender" facet of element', ""), ) @@ -188,8 +188,8 @@ test_show_element = ( (2, "> ", "show element mudpy.limit"), (2, r'These are the properties of the "mudpy\.limit" element.*' r' \x1b\[32mpassword_tries: \x1b\[31m3.*> ', - "show element actor:avatar:admin:0"), - (2, r'These are the properties of the "actor:avatar:admin:0" element.*' + "show element actor.avatar_admin_0"), + (2, r'These are the properties of the "actor.avatar_admin_0" element.*' r' \x1b\[32mgender: \x1b\[31mfemale.*> ', ""), ) -- 2.11.0