Re: KeyConfig, KeyBinding and other related issues.
Saimadhav Heblikar <[email protected]>
| Newsgroups | gmane.comp.python.idle |
|---|---|
| Message-ID | <CAO3PiBg56F_O0-Z6NhDSNujqa2f+GVHFCNNMsTqtpDeEzAOD1w@mail.gmail.com> |
Hi, I followed the above direction and made some progress. Lib/tkinter/__init__.py Line 998, gives some more info on the syntax for keysequence. https://gist.github.com/sahutd/289d2297eb83a020a6dd#file-test-keyseq-v2-diff. It only covers a few exceptions. I am posting this early, before I am far away in the wrong direction. Also, is the key_ok method intended as a replacement for the existing KeysOk method? Or are both going to exist? On 14 June 2014 15:46, Tal Einat <[email protected]> wrote: > > 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.) > Grouping required a single line of regex. pat = '^<(?P<modifiers>(({modifier})-){{0,3}})(({type})-)?({detail})>$'.format(modifier=modifier_regex,type=type_regex, detail=detail_regex) > > 3) return the groups > > Each step should give an informative message if an error is encountered. > For the above point, should key_ok method raise an error or return False or display a tkMessageBox ? -- Regards Saimadhav Heblikar