當前位置: 首頁>>代碼示例>>Python>>正文


Python base.BaseScenario類代碼示例

本文整理匯總了Python中papyon.service.AddressBook.scenario.base.BaseScenario的典型用法代碼示例。如果您正苦於以下問題:Python BaseScenario類的具體用法?Python BaseScenario怎麽用?Python BaseScenario使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了BaseScenario類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, sharing, callback, errback, scenario,
                 account, network, state, old_membership, new_membership):
        """Updates contact memberships.

           @type scenario: L{Scenario<papyon.service.AddressBook.scenario.base.Scenario>}
           @type network: L{NetworkID<papyon.profile.NetworkID>}
           @type old_membership: bitmask of L{Membership<papyon.profile.Membership>}
           @type new_membership: bitmask of L{Membership<papyon.profile.Membership>}
        """
        BaseScenario.__init__(self, scenario, callback, errback)
        self.__sharing = sharing

        self.account = account
        self.contact_type = UpdateMembershipsScenario.__contact_type[network]
        self.old = old_membership
        self.new = new_membership
        self.state = state

        # We keep a trace of what changes are actually done to pass it through
        # the callback or the errback so that the executor of the scenario can
        # update the memberships property of the contact.
        self.__done = old_membership

        # Subscription to the REVERSE or ALLOW lists can only occur when the
        # contact is member of the PENDING list, so when a subscription to the
        # REVERSE or ALLOW membership is detected, we delay the eventual deletion
        # from the PENDING membership list.
        self.__late_pending_delete = False
開發者ID:AmiZya,項目名稱:emesene,代碼行數:28,代碼來源:update_memberships.py

示例2: __init__

    def __init__(self, ab, callback, errback,
                 account='',
                 network_id=NetworkID.MSN,
                 memberships=Membership.NONE,
                 contact_type=ContactType.REGULAR,
                 contact_info={},
                 invite_display_name='',
                 invite_message=''):
        """Adds a messenger contact and updates the address book.

            @param ab: the address book service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)"""
        BaseScenario.__init__(self, Scenario.CONTACT_SAVE, callback, errback)

        self._ab = ab

        self.account = account
        self.network_id = network_id

        self.contact_type = contact_type
        self.contact_info = contact_info

        self.invite_display_name = invite_display_name
        self.invite_message = invite_message
        self.auto_manage_allow_list = True
        self.memberships = memberships
開發者ID:DarKprince,項目名稱:emesene2,代碼行數:27,代碼來源:messenger_contact_add.py

示例3: __init__

    def __init__(self, sharing, callback, errback):
        """Checks the pending invitations.

            @param sharing: the membership service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)
        """
        BaseScenario.__init__(self, Scenario.MESSENGER_PENDING_LIST, callback, errback)
        self.__sharing = sharing
開發者ID:DarKprince,項目名稱:emesene2,代碼行數:9,代碼來源:check_pending_invite.py

示例4: __init__

    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
開發者ID:DarKprince,項目名稱:emesene2,代碼行數:10,代碼來源:contact_find.py

示例5: __init__

    def __init__(self, ab, callback, errback, group_name=''):
        """Adds a group to the address book.

            @param ab: the address book service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)
            @param group_name: the name of the new group"""
        BaseScenario.__init__(self, 'GroupSave', callback, errback)
        self.__ab = ab

        self.group_name = group_name
開發者ID:snowpunk,項目名稱:papyon,代碼行數:11,代碼來源:group_add.py

示例6: __init__

    def __init__(self, ab, callback, errback, contact_guid=''):
        """Deletes a contact from the address book.

            @param ab: the address book service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)
            @param contact_guid: the guid of the contact to delete"""
        BaseScenario.__init__(self, Scenario.TIMER, callback, errback)
        self.__ab = ab

        self.contact_guid = contact_guid
開發者ID:DarKprince,項目名稱:emesene2,代碼行數:11,代碼來源:contact_delete.py

示例7: __init__

    def __init__(self, ab, callback, errback, email_address="", contact_info={}):
        """Adds a mail contact and updates the address book.

            @param ab: the adress book service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)"""
        BaseScenario.__init__(self, Scenario.CONTACT_SAVE, callback, errback)
        self.__ab = ab

        self.__email_address = email_address
        self.__contact_info = contact_info
開發者ID:Alberto-Beralix,項目名稱:Beralix,代碼行數:11,代碼來源:email_contact_add.py

示例8: __init__

    def __init__(self, ab, callback, errback, group_guid=''):
        """Deletes a group from the address book.

            @param ab: the address book service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)
            @param group_guid: the guid of the group to delete"""
        BaseScenario.__init__(self, 'GroupSave', callback, errback)
        self.__ab = ab

        self.group_guid = group_guid
開發者ID:DarKprince,項目名稱:emesene2,代碼行數:11,代碼來源:group_delete.py

示例9: __init__

    def __init__(self, ab, callback, errback, 
                 phone_number="", contact_info={}):
        """Adds a mobile contact and updates the address book.

            @param ab: the adress book service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)"""
        BaseScenario.__init__(self, Scenario.MOBILE_CONTACT_MSGR_API, callback, errback)
        self.__ab = ab

        self.__phone_number = phone_number
        self.__contact_info = contact_info
開發者ID:snowpunk,項目名稱:papyon,代碼行數:12,代碼來源:mobile_contact_add.py

示例10: __init__

    def __init__(self, ab, callback, errback, group_guid='', group_name=''):
        """Renames a group to the address book.

            @param ab: the address book service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)
            @param group_guid: the guid of the group to rename
            @param group_name: the new name for the group"""
        BaseScenario.__init__(self, 'GroupSave', callback, errback)
        self.__ab = ab

        self.group_guid = group_guid
        self.group_name = group_name
開發者ID:snowpunk,項目名稱:papyon,代碼行數:13,代碼來源:group_rename.py

示例11: __init__

    def __init__(self, ab, callback, errback, group_guid='', contact_guid=''):
        """Adds a contact to a group.

            @param ab: the address book service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)
            @param group_guid: the guid of the group
            @param contact_guid: the guid of the contact to add to the group"""
        BaseScenario.__init__(self, 'GroupSave', callback, errback)
        self.__ab = ab

        self.group_guid = group_guid
        self.contact_guid = contact_guid
開發者ID:DarKprince,項目名稱:emesene2,代碼行數:13,代碼來源:group_contact_add.py

示例12: __init__

    def __init__(self, ab, callback, errback, contact_guid='',
                 contact_properties={}):
        """Updates a contact properties

            @param ab: the address book service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)
            @param contact_guid: the guid of the contact to update"""
        BaseScenario.__init__(self, Scenario.CONTACT_SAVE, callback, errback)
        self.__ab = ab

        self.contact_guid = contact_guid
        self.contact_properties = contact_properties
        self.enable_allow_list_management = False
開發者ID:snowpunk,項目名稱:papyon,代碼行數:14,代碼來源:contact_update_properties.py

示例13: __init__

    def __init__(self, sharing, callback, errback, account='',
                 network=NetworkID.MSN, membership=Membership.NONE,
                 state='Accepted'):
        """Unblocks a contact.

            @param sharing: the membership service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)
        """
        BaseScenario.__init__(self, Scenario.BLOCK_UNBLOCK, callback, errback)
        self.__sharing = sharing

        self.account = account
        self.network = network
        self.membership = membership
        self.state = state
開發者ID:Alberto-Beralix,項目名稱:Beralix,代碼行數:16,代碼來源:unblock_contact.py

示例14: __init__

    def __init__(self, address_book, membership, callback, errback, account=''):
        """Synchronizes the membership content when logging in.

            @param membership: the address book service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)
        """
        BaseScenario.__init__(self, 'Initial', callback, errback)
        self.__membership = membership
        self.__address_book = address_book

        self.__membership_response = None
        self.__ab_response = None
        self.__creating_ab = False

        self.__account = account
開發者ID:DarKprince,項目名稱:emesene2,代碼行數:16,代碼來源:initial_sync.py

示例15: __init__

    def __init__(self, address_book, sharing, callback, errback, account=''):
        """Synchronizes the membership content when logging in.

            @param address_book: the address book service
            @param sharing: the sharging service
            @param callback: tuple(callable, *args)
            @param errback: tuple(callable, *args)
        """
        BaseScenario.__init__(self, 'Initial', callback, errback)
        self.__address_book = address_book
        self.__sharing = sharing

        self.__membership_response = None
        self.__ab_response = None

        self.__account = account
開發者ID:Alberto-Beralix,項目名稱:Beralix,代碼行數:16,代碼來源:initial_sync.py


注:本文中的papyon.service.AddressBook.scenario.base.BaseScenario類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。