From 9820d284388cf79176b25a9f447fc0f01d5f59a5 Mon Sep 17 00:00:00 2001 From: jamesvclemence Date: Fri, 23 Jan 2009 17:49:04 +0000 Subject: [PATCH] Fixed the lack of cycling through a list of given objects in @cpattr --- src/commands/objmanip.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/commands/objmanip.py b/src/commands/objmanip.py index 4fc35af306..cecbd93009 100644 --- a/src/commands/objmanip.py +++ b/src/commands/objmanip.py @@ -344,15 +344,13 @@ def cmd_cpattr(command): # Does target exist? if not tar_obj: session.msg("Target object does not exist: " + tar_string) - return # If target attribute is not given, use source_attr_string for name if tar_attr_string == '': -# session.msg("Testing") src_attr_contents = src_obj.get_attribute_value(source_attr_string) tar_obj.set_attribute(source_attr_string, src_attr_contents) - return - + continue + # If however, the target attribute is given, check it exists and update accordingly # Does target attribute exist? @@ -363,13 +361,12 @@ def cmd_cpattr(command): if not tar_attr: src_attr_contents = src_obj.get_attribute_value(source_attr_string) tar_obj.set_attribute(tar_attr_string, src_attr_contents) - return - + continue + # If target has attribute, update its contents src_attr_contents = src_obj.get_attribute_value(source_attr_string) tar_obj.set_attribute(tar_attr_string, src_attr_contents) - session.msg(tar_obj.get_attribute_value(source_attr_string)) - + continue def cmd_nextfree(command): """