annotate plugins/dbus-buddyicons-example.py @ 13587:bfda68675f7b

[gaim-migrate @ 15972] another sametime client is polluting idle values. I've submitted a bug to their team, but this will help hide it sometimes committer: Tailor Script <tailor@pidgin.im>
author Christopher O'Brien <siege@pidgin.im>
date Thu, 06 Apr 2006 03:56:42 +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)