MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / format_shortcut

Method format_shortcut

site-packages/matplotlib/backend_tools.py:1030–1036  ·  view source on GitHub ↗

Converts a shortcut string from the notation used in rc config to the standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'.

(key_sequence)

Source from the content-addressed store, hash-verified

1028
1029 @staticmethod
1030 def format_shortcut(key_sequence):
1031 """
1032 Converts a shortcut string from the notation used in rc config to the
1033 standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'.
1034 """
1035 return (key_sequence if len(key_sequence) == 1 else
1036 re.sub(r"\+[A-Z]", r"+Shift\g<0>", key_sequence).title())
1037
1038 def _format_tool_keymap(self, name):
1039 keymaps = self.toolmanager.get_tool_keymap(name)

Callers 2

_format_tool_keymapMethod · 0.95
test_format_shortcutFunction · 0.80

Calls 2

titleMethod · 0.80
subMethod · 0.45

Tested by 1

test_format_shortcutFunction · 0.64