'Splits an emacs keydef into modifiers and keys. For example:
"M-S-a"     -> [\'mod4\', \'shift\'], \'a\'
"A-<minus>" -> [\'mod1\'], \'minus\'
"C-<Tab>"   -> [\'control\'], \'Tab\''

def parse(self, spec):

    mods = []
    keys = []
    for key in spec.split('-'):
        if (not key):
            break
        if (key in self.modifier_keys):
            if keys:
                msg = 'Modifiers    must    always    come    before    key/btn:    %s'
                raise utils.QtileError((msg % spec))
            mods.append(self.modifier_keys[key])
            continue
        if (len(key) == 1):
            keys.append(key)
            continue
        if ((len(key) > 3) and (key[0] == '<') and (key[(-1)] == '>')):
            keys.append(key[1:(-1)])
            continue
    if (not keys):
        msg = 'Invalid    key/btn    specifier:    %s'
        raise utils.QtileError((msg % spec))
    if (len(keys) > 1):
        msg = ('Key    chains    are    not    supported:    %s' % spec)
        raise utils.QtileError(msg)
    return (mods, keys[0])
