def processObject(self, obj): """Operate on the provided command object.""" # ask the user if we should continue if not obj.pre(self, "Change keys of this command?"): return # try to run the operation query.chkeys(obj, keystr=self.opts.keystr) obj.post(self, "keys changed")
def test_command_ops(command): print "cattr" tq.cattr(command, key="tags", value=["new", "tags"]) print "chkeys" tq.chkeys(command, keystr="newService")