DRYer
This commit is contained in:
parent
2f7b0d1d94
commit
7f1c371b6e
2 changed files with 5 additions and 1 deletions
|
|
@ -113,7 +113,7 @@ def as_str(defns: Sequence[KeyDefinition]) -> str:
|
|||
seen = set()
|
||||
uniq = []
|
||||
for d in reversed(defns):
|
||||
key = d.full_key_sequence_to_trigger, d.options.when_focus_on
|
||||
key = d.unique_identity_within_keymap
|
||||
if key not in seen:
|
||||
seen.add(key)
|
||||
uniq.append(d)
|
||||
|
|
|
|||
|
|
@ -1211,6 +1211,10 @@ def is_suitable_for_global_shortcut(self) -> bool:
|
|||
def full_key_sequence_to_trigger(self) -> Tuple[SingleKey, ...]:
|
||||
return (self.trigger,) + self.rest
|
||||
|
||||
@property
|
||||
def unique_identity_within_keymap(self) -> Tuple[Tuple[SingleKey, ...], str]:
|
||||
return self.full_key_sequence_to_trigger, self.options.when_focus_on
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return self.pretty_repr('is_sequence', 'trigger', 'rest', 'options')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue