annotate plugins/dbus-buddyicons-example.py @ 13968:6fc412e59214

[gaim-migrate @ 16525] A bunch of little things * Use GAIM_CONNECTION_IS_VALID(gc) in a lot of places where we were doing g_list_find(gaim_connections_get_all(), gc) * Get rid of a lot of places where we were doing g_list_find(gaim_connections_get_all(), gc). The handle used by the request API ensures that the ok and cancel callback functions won't be called if the gc is destroyed. However, GAIM_CONNECTION_IS_VALID(gc) is still very important for callback functions where we can't cancel the request. For example, gaim_proxy_connect() callback functions. * "Added" a function to Yahoo! that should help us notice when our buddies change their buddy icon/display picture * Some comments in a few places * Changed GAIM_CONNECTION_IS_VALID(gc) to only look through the list of "all" connections and not the list of "connecting" connections. Some time ago we changed how this was done so that the list of "all" connections now includes the "connection" connections. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 20 Jul 2006 08:11:54 +0000
parents c5c14bb91c28
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13556
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1 #!/usr/bin/env python
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
2 #
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
3 # Print the aliases of buddies who have a buddy-icon set.
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
4 #
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
5 # Gaim is the legal property of its developers, whose names are too numerous
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
6 # to list here. Please refer to the COPYRIGHT file distributed with this
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
7 # source distribution.
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
8 #
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
9 # This program is free software; you can redistribute it and/or modify
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
10 # it under the terms of the GNU General Public License as published by
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
11 # the Free Software Foundation; either version 2 of the License, or
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
12 # (at your option) any later version.
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
13 #
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
14 # This program is distributed in the hope that it will be useful,
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
17 # GNU General Public License for more details.
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
18 #
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
19 # You should have received a copy of the GNU General Public License
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
20 # along with this program; if not, write to the Free Software
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
22 #
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
23
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
24 import dbus
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
25
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
26 bus = dbus.SessionBus()
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
27 obj = bus.get_object("net.sf.gaim.GaimService", "/net/sf/gaim/GaimObject")
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
28 gaim = dbus.Interface(obj, "net.sf.gaim.GaimInterface")
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
29
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
30 node = gaim.GaimBlistGetRoot()
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
31 while node != 0:
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
32 if gaim.GaimBlistNodeIsBuddy(node):
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
33 icon = gaim.GaimBuddyGetIcon(node)
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
34 if icon != 0:
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
35 print gaim.GaimBuddyGetAlias(node)
c5c14bb91c28 [gaim-migrate @ 15934]
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
36 node = gaim.GaimBlistNodeNext(node, 0)