def collect(self, query, manager=None): command = self.commands[query][self.remote] if manager: command = command % manager command = command.replace('%%','%') output = Popen([command],stdout=PIPE,shell=True) result = output.stdout.read() handler = MQHandler(result.splitlines()) return handler.parseData(self.commands[query]['key'])