Пример #1
0
def resolve_grouped_commands(grouped, connection):
    results = {}

    for master_command, grouped_commands in grouped:
        result = master_command.resolve(connection)

        # this command was not grouped
        if len(grouped_commands) == 1:
            results[grouped_commands[0]] = result
        else:
            if isinstance(result, dict):
                # XXX: assume first arg is key
                for command in grouped_commands:
                    results[command] = result.get(command.get_args()[0])
            else:
                for command, value in izip(grouped_commands, result):
                    results[command] = value

    return results
Пример #2
0
 def execute(self):
     return dict(izip(self.pending, self.pipe.execute()))
Пример #3
0
 def execute(self):
     return dict(izip(self.pending, self.pipe.execute()))