From c81d238b0cf2c967cb67c2362c335ae7c199cbb8 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 9 Apr 2011 14:48:57 +0000 Subject: [PATCH] Fixed a bug in batchcommand that caused crashes. Resolves issue 153. --- src/commands/cmdsethandler.py | 2 +- src/commands/default/batchprocess.py | 21 +++++---------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/commands/cmdsethandler.py b/src/commands/cmdsethandler.py index c1c3f49765..7bbe90a28b 100644 --- a/src/commands/cmdsethandler.py +++ b/src/commands/cmdsethandler.py @@ -367,7 +367,7 @@ class CmdSetHandler(object): """ self.cmdset_stack = [self.cmdset_stack[0]] self.mergetype_stack = [self.cmdset_stack[0].mergetype] - self.permanent_paths[0] = [self.permanent_paths[0]] + self.permanent_paths = [self.permanent_paths[0]] self.obj.cmdset_storage = self.permanent_paths self.update() diff --git a/src/commands/default/batchprocess.py b/src/commands/default/batchprocess.py index 7d64918a4f..fa85e3b0d6 100644 --- a/src/commands/default/batchprocess.py +++ b/src/commands/default/batchprocess.py @@ -246,12 +246,7 @@ class CmdBatchCommands(MuxCommand): if not batch_cmd_exec(caller): return step_pointer(caller, 1) - # clean out the safety cmdset and clean out all other temporary attrs. - caller.cmdset.delete(BatchSafeCmdSet) - del caller.ndb.batch_stack - del caller.ndb.batch_stackptr - del caller.ndb.batch_pythonpath - del caller.ndb.batch_batchmode + # clean out the safety cmdset and clean out all other temporary attrs. string = " Batchfile '%s' applied." % python_path caller.msg("{G%s" % string) purge_processor(caller) @@ -334,12 +329,6 @@ class CmdBatchCode(MuxCommand): if not batch_code_exec(caller): return step_pointer(caller, 1) - # clean out the safety cmdset and clean out all other temporary attrs. - caller.cmdset.delete(BatchSafeCmdSet) - del caller.ndb.batch_stack - del caller.ndb.batch_stackptr - del caller.ndb.batch_pythonpath - del caller.ndb.batch_batchmode string = " Batchfile '%s' applied." % python_path caller.msg("{G%s" % string) purge_processor(caller) @@ -415,9 +404,9 @@ class CmdStateRR(MuxCommand): def func(self): caller = self.caller if caller.ndb.batch_batchmode == "batch_code": - BATCHCODE.read_file(caller.ndb.batch_pythonpath) + BATCHCODE.parse_file(caller.ndb.batch_pythonpath) else: - BATCHCMD.read_file(caller.ndb.batch_pythonpath) + BATCHCMD.parse_file(caller.ndb.batch_pythonpath) caller.msg(format_code("File reloaded. Staying on same command.")) show_curr(caller) @@ -435,9 +424,9 @@ class CmdStateRRR(MuxCommand): def func(self): caller = self.caller if caller.ndb.batch_batchmode == "batch_code": - BATCHCODE.read_file(caller.ndb.batch_pythonpath) + BATCHCODE.parse_file(caller.ndb.batch_pythonpath) else: - BATCHCMD.read_file(caller.ndb.batch_pythonpath) + BATCHCMD.parse_file(caller.ndb.batch_pythonpath) caller.ndb.batch_stackptr = 0 caller.msg(format_code("File reloaded. Restarting from top.")) show_curr(caller)