comparison plugins/dbus-buddyicons-example.py @ 13556:c5c14bb91c28

[gaim-migrate @ 15934] Adding a DBUS example script written by Sadrul. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 23 Mar 2006 18:42:25 +0000
parents
children
comparison
equal deleted inserted replaced
13555:a7b24ba66570 13556:c5c14bb91c28
1 #!/usr/bin/env python
2 #
3 # Print the aliases of buddies who have a buddy-icon set.
4 #
5 # Gaim is the legal property of its developers, whose names are too numerous
6 # to list here. Please refer to the COPYRIGHT file distributed with this
7 # source distribution.
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #
23
24 import dbus
25
26 bus = dbus.SessionBus()
27 obj = bus.get_object("net.sf.gaim.GaimService", "/net/sf/gaim/GaimObject")
28 gaim = dbus.Interface(obj, "net.sf.gaim.GaimInterface")
29
30 node = gaim.GaimBlistGetRoot()
31 while node != 0:
32 if gaim.GaimBlistNodeIsBuddy(node):
33 icon = gaim.GaimBuddyGetIcon(node)
34 if icon != 0:
35 print gaim.GaimBuddyGetAlias(node)
36 node = gaim.GaimBlistNodeNext(node, 0)