Made a change to the cmdset comparison algorithm to make sure all commands are compared both by alias and key by use of a set-intersection operation. Before one side of the comparison used key and the other used key+aliases, which led to inconsistent results in some situations, especially when combining system commands with aliases.

This commit is contained in:
Griatch 2015-06-28 17:58:42 +02:00
parent 3cc816c58c
commit 45e0785c8e
2 changed files with 3 additions and 2 deletions

View file

@ -411,7 +411,7 @@ class CmdSet(object):
elif mergetype == "Replace":
cmdset_c = self._replace(cmdset_b, self)
elif mergetype == "Remove":
cmdset_c = self._remove(self, cmdset_b)
cmdset_c = self._remove(cmdset_b, self)
else: # Union
cmdset_c = self._union(cmdset_b, self)
cmdset_c.no_channels = cmdset_b.no_channels

View file

@ -184,7 +184,8 @@ class Command(object):
"""
try:
# first assume input is a command (the most common case)
return cmd.key in self._matchset
return self._matchset.intersection(cmd._matchset)
#return cmd.key in self._matchset
except AttributeError:
# probably got a string
return cmd in self._matchset