diff options
Diffstat (limited to 'papyon/service/AddressBook/scenario/contacts/contact_find.py')
-rw-r--r-- | papyon/service/AddressBook/scenario/contacts/contact_find.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/papyon/service/AddressBook/scenario/contacts/contact_find.py b/papyon/service/AddressBook/scenario/contacts/contact_find.py deleted file mode 100644 index 8641ba6..0000000 --- a/papyon/service/AddressBook/scenario/contacts/contact_find.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2009 Collabora Ltd. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -from papyon.service.AddressBook.scenario.base import BaseScenario - -__all__ = ['FindContactScenario'] - -class FindContactScenario(BaseScenario): - """Scenario used to find a contact in the address book""" - - def __init__(self, ab, callback, errback, scenario, id=''): - """Updates contact memberships. - - @type scenario: L{Scenario<papyon.service.AddressBook.scenario.base.Scenario>} - @type account: account name of the contact to find - """ - BaseScenario.__init__(self, scenario, callback, errback) - self.__ab = ab - - self.id = id - - def execute(self): - self.__ab.FindAll((self.__find_all_callback, self.id), - self._errback, self._scenario, True) - - def __find_all_callback(self, address_book_delta, id): - found_contact = None - contacts = address_book_delta.contacts - for contact in contacts: - if contact.Id == id: - found_contact = contact - break - self.callback(found_contact) |