[Idle-dev] KeyConfig, KeyBinding and other related issues.

Tal Einat taleinat at gmail.com
Sat Jun 14 12:16:06 CEST 2014

On Sat, Jun 14, 2014 at 10:29 AM, Tal Einat <taleinat at gmail.com> wrote:

> As can be seen in your patch, parsing with regexps tends to get even
> messier. I believe removing the '<' and '>' and the ends and splitting
> by '-' will be much simpler. Just make sure to group the pieces into
> the three relevant groups: modifier(s), type and detail (see [1]),
> while preserving the order of the items in each group.

To give a bit more direction on the implementation, the steps for the
parsing function should be roughly:

1) basic parsing: remove '<' and '>' and ends and split by '-'
2) group parts into the three groups while checking that they are
valid (not empty, etc.)
3) return the groups

Each step should give an informative message if an error is encountered.

The validity checking function could check that each group is valid,
e.g. no modifier appears more than once, no more than one type and one
detail appear, etc.

The canonization function could take that output and build a keysym from it.

- Tal

More information about the IDLE-dev mailing list