MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / format_shortcut

Method format_shortcut

lib/matplotlib/backend_tools.py:894–900  ·  view source on GitHub ↗

Convert 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

892
893 @staticmethod
894 def format_shortcut(key_sequence):
895 """
896 Convert a shortcut string from the notation used in rc config to the
897 standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'.
898 """
899 return (key_sequence if len(key_sequence) == 1 else
900 re.sub(r"\+[A-Z]", r"+Shift\g<0>", key_sequence).title())
901
902 def _format_tool_keymap(self, name):
903 keymaps = self.toolmanager.get_tool_keymap(name)

Callers 2

_format_tool_keymapMethod · 0.95
test_format_shortcutFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_format_shortcutFunction · 0.64