After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701063 - Lack of examples in pyatspi2
Lack of examples in pyatspi2
Status: RESOLVED FIXED
Product: pyatspi2
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Li Yuan
pyatspi2 maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-05-26 22:17 UTC by Magdalen Berns (irc magpie)
Modified: 2015-02-27 16:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Prints keypress in active window (1.63 KB, patch)
2013-05-26 22:42 UTC, Magdalen Berns (irc magpie)
none Details | Review
Prints keypress in active window (2.28 KB, patch)
2013-05-27 18:33 UTC, Magdalen Berns (irc magpie)
none Details | Review
Prints keypress in active window (2.34 KB, patch)
2013-05-27 21:15 UTC, Magdalen Berns (irc magpie)
committed Details | Review
Example to demonstrate text interface use (2.47 KB, patch)
2013-05-31 17:12 UTC, Magdalen Berns (irc magpie)
committed Details | Review
Patch to fix indentation of caret.py (1.54 KB, patch)
2013-05-31 17:14 UTC, Magdalen Berns (irc magpie)
committed Details | Review
Obsoletes Prints keypress in active window which had spelling mistake. (2.46 KB, patch)
2013-06-03 17:50 UTC, Magdalen Berns (irc magpie)
none Details | Review
Counts number of running applications. (1.62 KB, patch)
2013-06-03 17:51 UTC, Magdalen Berns (irc magpie)
reviewed Details | Review
Update Makefile.am to include added files. (697 bytes, patch)
2013-06-03 17:52 UTC, Magdalen Berns (irc magpie)
committed Details | Review
print number of accessible apps running (2.21 KB, patch)
2013-06-03 21:43 UTC, Magdalen Berns (irc magpie)
committed Details | Review

Description Magdalen Berns (irc magpie) 2013-05-26 22:17:36 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
Comment 1 Magdalen Berns (irc magpie) 2013-05-26 22:42:39 UTC
Created attachment 245361 [details] [review]
Prints keypress in active window
Comment 2 Joanmarie Diggs (IRC: joanie) 2013-05-27 08:39:55 UTC
(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.
Comment 3 Juanjo Marín 2013-05-27 08:45:50 UTC
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.
Comment 4 Magdalen Berns (irc magpie) 2013-05-27 18:33:07 UTC
Created attachment 245403 [details] [review]
 Prints keypress in active window
Comment 5 Joanmarie Diggs (IRC: joanie) 2013-05-27 18:44:30 UTC
(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.
Comment 6 Magdalen Berns (irc magpie) 2013-05-27 21:15:54 UTC
Created attachment 245412 [details] [review]
Prints keypress in active window
Comment 7 Magdalen Berns (irc magpie) 2013-05-31 17:12:58 UTC
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
Comment 8 Magdalen Berns (irc magpie) 2013-05-31 17:14:33 UTC
Created attachment 245764 [details] [review]
Patch to fix indentation of caret.py

Part 2/2
Comment 9 Magdalen Berns (irc magpie) 2013-05-31 17:27:07 UTC
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
Comment 10 Mike Gorse 2013-06-03 16:43:36 UTC
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.
Comment 11 Magdalen Berns (irc magpie) 2013-06-03 17:50:52 UTC
Created attachment 245943 [details] [review]
Obsoletes Prints keypress in active window which had spelling mistake.
Comment 12 Magdalen Berns (irc magpie) 2013-06-03 17:51:36 UTC
Created attachment 245944 [details] [review]
Counts number of running applications.
Comment 13 Magdalen Berns (irc magpie) 2013-06-03 17:52:30 UTC
Created attachment 245945 [details] [review]
Update Makefile.am to include added files.
Comment 14 Mike Gorse 2013-06-03 18:18:23 UTC
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!
Comment 15 Magdalen Berns (irc magpie) 2013-06-03 21:43:19 UTC
Created attachment 245966 [details] [review]
print number of accessible apps running
Comment 16 Magdalen Berns (irc magpie) 2013-06-03 21:44:33 UTC
Thanks for that. This indeed was the case.
Comment 17 Mike Gorse 2013-06-10 15:36:21 UTC
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.
Comment 18 André Klapper 2015-02-27 16:40:59 UTC
[Moving at-spi/pyatspi2 bugs to separate product. See bug 740075]