From 2729369027f8492e563b403e4e606c5b49c04620 Mon Sep 17 00:00:00 2001 From: lagos Date: Tue, 12 Jun 2012 07:35:50 +0000 Subject: [PATCH 1/2] Fixes two typos in sample code for evlang. --- contrib/evlang/README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/evlang/README b/contrib/evlang/README index edaa7e0d3..98ea07a72 100644 --- a/contrib/evlang/README +++ b/contrib/evlang/README @@ -97,7 +97,7 @@ These all return True after successful execution, which makes especially the msg* functions easier to use in a conditional. Let's try it. - @code crate/look = if caller.key=='Superman' and evl.msg("Your gaze burns a small hole.") or evl.msg("Looks robust!") + @code crate/look = caller.key=='Superman' and evl.msg("Your gaze burns a small hole.") or evl.msg("Looks robust!") Now look at the crate. :) @@ -105,5 +105,5 @@ You can (in evlang) use evl.list() to get a list of all methods currently stored use the same look slot on the crate again. But this time we'll use the /debug mode of @code, which means the script will be auto-run immediately and we don't have to look at the create to get a result when developing. -@code/debug create/look = evl.msg(evl.list()) +@code/debug crate/look = evl.msg(evl.list()) From 1c4c3a4217f19d0df6ad6e2109e4ba0718aeaae7 Mon Sep 17 00:00:00 2001 From: lagos Date: Tue, 12 Jun 2012 08:09:15 +0000 Subject: [PATCH 2/2] chargen.py uses managers instead of db_objects. --- contrib/chargen.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/chargen.py b/contrib/chargen.py index aef4f750e..cdb3989df 100644 --- a/contrib/chargen.py +++ b/contrib/chargen.py @@ -29,7 +29,7 @@ following line to the end of OOCCmdSet's at_cmdset_creation(): from django.conf import settings from ev import Command, create_object, utils -from ev import default_cmds, db_objects +from ev import default_cmds, managers CHARACTER_TYPECLASS = settings.BASE_CHARACTER_TYPECLASS @@ -84,7 +84,7 @@ class CmdOOCLook(default_cmds.CmdLook): if not avail_chars: self.caller.msg("You have no characters to look at. Why not create one?") return - objs = db_objects.get_objs_with_key_and_typeclass(self.args.strip(), CHARACTER_TYPECLASS) + objs = managers.objects.get_objs_with_key_and_typeclass(self.args.strip(), CHARACTER_TYPECLASS) objs = [obj for obj in objs if obj.id in avail_chars] if not objs: self.caller.msg("You cannot see this Character.") @@ -97,7 +97,7 @@ class CmdOOCLook(default_cmds.CmdLook): charnames = [] if self.caller.db._character_dbrefs: dbrefs = self.caller.db._character_dbrefs - charobjs = [db_objects.get_id(dbref) for dbref in dbrefs] + charobjs = [managers.objects.get_id(dbref) for dbref in dbrefs] charnames = [charobj.key for charobj in charobjs if charobj] if charnames: charlist = "The following Character(s) are available:\n\n" @@ -154,7 +154,7 @@ class CmdOOCCharacterCreate(Command): self.caller.msg("Usage: create ") return charname = self.args.strip() - old_char = db_objects.get_objs_with_key_and_typeclass(charname, CHARACTER_TYPECLASS) + old_char = managers.objects.get_objs_with_key_and_typeclass(charname, CHARACTER_TYPECLASS) if old_char: self.caller.msg("Character {c%s{n already exists." % charname) return