From 7f42ff445f9df71df8ae88c27fbf2e4241b4f006 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Fri, 25 May 2007 18:24:24 +0000 Subject: [PATCH] We definitely need the fix from the branch to the attribute deletion method, but we'll keep the existing @wipe implementation. Sorry for the confusion. --- commands_general.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/commands_general.py b/commands_general.py index bb7929c550..f45ecc8b76 100644 --- a/commands_general.py +++ b/commands_general.py @@ -339,47 +339,6 @@ def cmd_who(cdat): session.msg(retval) -def cmd_wipe(cdat): - """ - Wipe all attributes from a given object. - """ - session = cdat['session'] - pobject = session.get_pobject() - args = cdat['uinput']['splitted'][1:] - wildcard = wildcard_to_regexp(cdat['uinput']['root_chunk'][1]) - has_wildcard = False - - if wildcard: - has_wildcard = True - - if len(args) == 0: - session.msg("Wipe attributes from what?") - return - else: - target_obj = functions_db.standard_plr_objsearch(session, ' '.join(args)) - - # Use standard_plr_objsearch to handle duplicate/nonexistant results. - if not target_obj: - return - if target_obj.is_player() and not pobject.controls_other(target_obj): - session.msg("I'm sorry, you do not have permission to wipe attributes from that player.") - return - if has_wildcard: - import re - deleted_attribs = [] - attribs = target_obj.get_all_attributes() - for attrib in attribs: - pattern = re.compile(wildcard) - if pattern.match(attrib.name): - deleted_attribs.append(attrib.name) - attrib.delete() - session.message("Attribute(s) %s deleted." % ', '.join(deleted_attribs)) - return - else: - target_obj.clear_all_attributes() - session.msg("All non-hidden attributes deleted.") - return - def cmd_say(cdat): """ Room-based speech command.