From 75956de7d162ceebfac16d02c419e343e9ead41b Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 20 Mar 2011 23:14:36 +0000 Subject: [PATCH] Small bugfixes in the wake of the cmdset changes. Resolves issue 148. --- src/commands/cmdsethandler.py | 4 ++-- src/commands/default/tests.py | 5 +++++ src/typeclasses/models.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/commands/cmdsethandler.py b/src/commands/cmdsethandler.py index b333c9e2bb..0d3ef2aaf7 100644 --- a/src/commands/cmdsethandler.py +++ b/src/commands/cmdsethandler.py @@ -288,10 +288,10 @@ class CmdSetHandler(object): if cmdset: if self.cmdset_stack: self.cmdset_stack[0] = cmdset - self.mergetype_stack.insert[0] = cmdset.mergetype + self.mergetype_stack[0] = cmdset.mergetype else: self.cmdset_stack = [cmdset] - self.mergetype_stack = cmdset.mergetype + self.mergetype_stack = [cmdset.mergetype] if permanent: if self.permanent_paths: diff --git a/src/commands/default/tests.py b/src/commands/default/tests.py index 28be704079..7c9203146b 100644 --- a/src/commands/default/tests.py +++ b/src/commands/default/tests.py @@ -223,6 +223,7 @@ class TestPy(CommandTest): self.execute_cmd("@py 1+2", [">>> 1+2", "<<< 3"]) class TestScripts(CommandTest): def test_call(self): + script = create.create_script(None, "test") self.execute_cmd("@scripts", "id") class TestObjects(CommandTest): def test_call(self): @@ -272,4 +273,8 @@ class TestWall(CommandTest): # building.py command tests +class TestScript(CommandTest): + def test_call(self): + self.execute_cmd("@script TestChar = examples.bodyfunctions.BodyFunctions", "Script successfully added") + #TODO diff --git a/src/typeclasses/models.py b/src/typeclasses/models.py index 4a08940e91..ce8105f64b 100644 --- a/src/typeclasses/models.py +++ b/src/typeclasses/models.py @@ -612,7 +612,7 @@ class TypedObject(SharedMemoryModel): errstring += "\nThis seems to be just the path to a module. You need" errstring += " to specify the actual typeclass name inside the module too." errstring += "\n Typeclass '%s' failed to load." % path - defpath = object.__getattribute__(self, default_typeclass_path) + defpath = object.__getattribute__(self, "default_typeclass_path") errstring += " Using Default class '%s'." % defpath self.db_typeclass_path = defpath self.save()