'Merge this cmdset (B) with another cmdset (A) using the + operator,
C = B + A
Here, we (by convention) say that \'A is merged onto B to form
C\'.  The actual merge operation used in the \'addition\' depends
on which priorities A and B have. The one of the two with the
highest priority will apply and give its properties to C. In
the case of a tie, A  takes priority and replaces the
same-named commands in B unless A has the \'duplicate\' variable
set (which means both sets\' commands are kept).'

def __add__(self, cmdset_a):

    if (not cmdset_a):
        return self
    sys_commands_a = cmdset_a.get_system_cmds()
    sys_commands_b = self.get_system_cmds()
    if (self.priority <= cmdset_a.priority):
        sys_commands = (sys_commands_a + [cmd for cmd in sys_commands_b if (cmd not in sys_commands_a)])
        mergetype = cmdset_a.key_mergetypes.get(self.key, cmdset_a.mergetype)
        if (mergetype == 'Intersect'):
            cmdset_c = self._intersect(cmdset_a, self)
        elif (mergetype == 'Replace'):
            cmdset_c = self._replace(cmdset_a, self)
        elif (mergetype == 'Remove'):
            cmdset_c = self._remove(cmdset_a, self)
        else:
            cmdset_c = self._union(cmdset_a, self)
        cmdset_c.no_channels = (self.no_channels if (cmdset_a.no_channels is None) else cmdset_a.no_channels)
        cmdset_c.no_exits = (self.no_exits if (cmdset_a.no_exits is None) else cmdset_a.no_exits)
        cmdset_c.no_objs = (self.no_objs if (cmdset_a.no_objs is None) else cmdset_a.no_objs)
    else:
        sys_commands = (sys_commands_b + [cmd for cmd in sys_commands_a if (cmd not in sys_commands_b)])
        mergetype = self.key_mergetypes.get(cmdset_a.key, self.mergetype)
        if (mergetype == 'Intersect'):
            cmdset_c = self._intersect(self, cmdset_a)
        elif (mergetype == 'Replace'):
            cmdset_c = self._replace(self, cmdset_a)
        elif (mergetype == 'Remove'):
            cmdset_c = self._remove(self, cmdset_a)
        else:
            cmdset_c = self._union(self, cmdset_a)
        cmdset_c.no_channels = (cmdset_a.no_channels if (self.no_channels is None) else self.no_channels)
        cmdset_c.no_exits = (cmdset_a.no_exits if (self.no_exits is None) else self.no_exits)
        cmdset_c.no_objs = (cmdset_a.no_objs if (self.no_objs is None) else self.no_objs)
    cmdset_c.actual_mergetype = mergetype
    cmdset_c.add(sys_commands)
    return cmdset_c
