1
# -*- coding: utf-8 -*-
3
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com>
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
import contactcardservice
23
from pymsn.service.SOAPUtils import *
25
import pymsn.util.ElementTree as ElementTree
26
import pymsn.util.StringIO as StringIO
33
class Spaces(gobject.GObject):
36
"contact-card-retreived" : (gobject.SIGNAL_RUN_FIRST,
42
def __init__(self, sso, proxies=None):
43
gobject.GObject.__init__(self)
45
self._ccard = contactcardservice.ContactCardService(sso, proxies)
48
def get_contact_card(self, contact):
49
ccs = scenario.GetContactCardScenario(self._ccard,
51
(self.__get_contact_card_cb, contact),
52
(self.__get_contact_card_errback,))
55
def __get_contact_card_cb(self, ccard, contact):
56
print "Contact card retreived : \n%s\n" % str(ccard)
57
self.emit('contact-card-retreived', contact, ccard)
59
def __get_contact_card_errback(self, error_code, *args):
60
print "The fetching of the contact card returned an error (%s)" % error_code