'Switch position of groupa to groupb'

def cmd_switch_groups(self, groupa, groupb):

    if ((groupa not in self.groupMap) or (groupb not in self.groupMap)):
        return
    indexa = self.groups.index(self.groupMap[groupa])
    indexb = self.groups.index(self.groupMap[groupb])
    (self.groups[indexa], self.groups[indexb]) = (self.groups[indexb], self.groups[indexa])
    hook.fire('setgroup')
    for group in (self.groups[indexa], self.groups[indexb]):
        for w in group.windows:
            w.group = group
