annotate plugins/dbus-buddyicons-example.py @ 13962:b43aec5fa9eb

[gaim-migrate @ 16515] Fix a tiny and rare memleak when unloading a plugin that was designed for an older version of Gaim. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 18 Jul 2006 06:33:36 +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)