GNOME Bugzilla – Bug 701063
Lack of examples in pyatspi2
Last modified: 2015-02-27 16:40:59 UTC
There should be more examples in pyatspi2 because at the moment there is only one. Things like a file to show the hierarchy from keypress events in an active window would be useful. The current examples folder: https://git.gnome.org/browse/pyatspi2/tree/examples
Created attachment 245361 [details] [review] Prints keypress in active window
(In reply to comment #1) > Created an attachment (id=245361) [details] [review] > Prints keypress in active window The patch 'review' functionality is getting stuck on 'loading...' for some reason. :-/ Anyhoo.... 1. If you always return True in your keyevent callback, independent of what key is pressed, you can wind up consuming key presses you do not wish to consume. Were it me, I'd only return True for F3 and F4. 2. Nit: Your callback is called on_key_press() but it handles both key press and key release input events. (Yeah, it filters out the latter, but it still gets called). 3. Uber-nit: Please put a space after commas.
Magdalen: The patch is not in the in the standard git format for submission. You can generate a patch with this format with the following command: git format-patch HEAD^ This makes a patch out of your last commit, including the changes, the commit message, and your contact information.
Created attachment 245403 [details] [review] Prints keypress in active window
(In reply to comment #4) > Created an attachment (id=245403) [details] [review] > Prints keypress in active window Nice job creating the patch in a more GNOME like fashion! :) Please see my points in comment #2 which also apply to this new version.
Created attachment 245412 [details] [review] Prints keypress in active window
Created attachment 245763 [details] [review] Example to demonstrate text interface use I have made a change to this so there are two patches since there is an indentation in the last print statement. This is part 1/2
Created attachment 245764 [details] [review] Patch to fix indentation of caret.py Part 2/2
Comment on attachment 245412 [details] [review] Prints keypress in active window If there are any problems when testing this example please read about this bug and check your keyboard. https://bugzilla.gnome.org/show_bug.cgi?id=384850
The example looks good to me. Btw, you can use git rebase to merge/rearrange commits if you, say, find a mistake in something that you've committed before you've pushed it to the server. I'm just pointing that out in case you didn't know about it. Also, caret.py should be added to EXTRA_DIST in examples/Makefile.am so that the example is added to the tarball. I'll just make that change and commit to save you the trouble of uploading another patch.
Created attachment 245943 [details] [review] Obsoletes Prints keypress in active window which had spelling mistake.
Created attachment 245944 [details] [review] Counts number of running applications.
Created attachment 245945 [details] [review] Update Makefile.am to include added files.
Comment on attachment 245944 [details] [review] Counts number of running applications. I'd suggest changing the comment, since it implies that pressing a key will print the active window (I'm guessing that you created this by modifying another example and forgot to update the comment). Looks good other than that. Thanks for your work!
Created attachment 245966 [details] [review] print number of accessible apps running
Thanks for that. This indeed was the case.
Comment on attachment 245412 [details] [review] Prints keypress in active window Committed; thanks for the patch! For future reference, lines of commit messages for GNOME projects should generally not exceed 74 characters, and the first line typically contains a brief summary of the change. See https://live.gnome.org/Git/CommitMessages. Also, you had some trailing whitespace in some places.
[Moving at-spi/pyatspi2 bugs to separate product. See bug 740075]