From: Jeremy Stanley Date: Thu, 9 Nov 2017 10:00:11 +0000 (+0000) Subject: Switch actors to new-style elements X-Git-Tag: 0.0.1~123 X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=commitdiff_plain;h=6eebfcc6d5885479d2b907ef2b228acdba140856;ds=sidebyside Switch actors to new-style elements Actor elements created for avatars now follow the new data model. --- 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.*> ', ""), )