'Implement the set attribute - a limited form of @py.'

def func(self):

    caller = self.caller
    if (not self.args):
        caller.msg('Usage:    @set    obj/attr    =    value.    Use    empty    value    to    clear.')
        return
    value = self.rhs
    objname = self.lhs_objattr[0]['name']
    attrs = self.lhs_objattr[0]['attrs']
    if objname.startswith('*'):
        obj = caller.search_player(objname.lstrip('*'))
    else:
        obj = caller.search(objname)
    if (not obj):
        return
    if (not self.check_obj(obj)):
        return
    result = []
    if ('edit' in self.switches):
        if (len(attrs) > 1):
            caller.msg('The    Line    editor    can    only    be    applied    to    one    attribute    at    a    time.')
            return
        self.edit_handler(obj, attrs[0])
        return
    if (not value):
        if (self.rhs is None):
            if (not attrs):
                attrs = [attr.key for attr in obj.attributes.all()]
            for attr in attrs:
                if (not self.check_attr(obj, attr)):
                    continue
                result.append(self.view_attr(obj, attr))
            self.caller.msg(''.join(result).strip(), options={'raw': True})
            return
        else:
            for attr in attrs:
                if (not self.check_attr(obj, attr)):
                    continue
                result.append(self.rm_attr(obj, attr))
    else:
        for attr in attrs:
            if (not self.check_attr(obj, attr)):
                continue
            value = _convert_from_string(self, value)
            result.append(self.set_attr(obj, attr, value))
    caller.msg(''.join(result).strip('\n'))
