← Back
Editing: interfaces.cpython-38.pyc
U ,�W A � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z dd lm Z dd lmZ ddlmZ ddlm Z dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ G dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZG d!d"� d"e�ZG d#d$� d$e �Z!G d%d&� d&e�Z"d'S )(z0Component and Component Architecture Interfaces � )� Attribute)� Interface)� implements)�ComponentLookupError)�Invalid)�IObjectEvent)�ObjectEvent)�IComponentLookup)� IRegistration)�IUtilityRegistration)�_IBaseAdapterRegistration)�IAdapterRegistration)� ISubscriptionAdapterRegistration)�IHandlerRegistration)�IRegistrationEvent)�RegistrationEvent)�IRegistered)� Registered)� IUnregistered)�Unregistered)�IComponentRegistry)�IComponents)�_BLANKc @ s� e Zd ZdZdd� Zd.dd�Zd/dd �Zd0d d�Zd1dd �Zd2dd�Z d3dd�Z d4dd�Zee dfdd�Zdd� Zeddfdd�Zee ddfdd�Zd5dd�Zee ddfdd�Zd6d d!�Zd7d"d#�Zd$d%� Zd&d'� Zd(d)� Zd8d*d+�Zd9d,d-�ZdS ):�IComponentArchitecturez�The Component Architecture is defined by two key components: Adapters and Utiltities. Both are managed by site managers. All other components build on top of them. c C s dS )z�Return the global site manager. This function should never fail and always return an object that provides `IGlobalSiteManager`. N� r r r �;/usr/lib/python3/dist-packages/zope/component/interfaces.py�getGlobalSiteManager3 s z+IComponentArchitecture.getGlobalSiteManagerNc C s dS )aH Get the nearest site manager in the given context. If `context` is `None`, return the global site manager. If the `context` is not `None`, it is expected that an adapter from the `context` to `IComponentLookup` can be found. If no adapter is found, a `ComponentLookupError` is raised. Nr )�contextr r r �getSiteManager: s z%IComponentArchitecture.getSiteManager� c C s dS )z�Get the utility that provides interface Returns the nearest utility to the context that implements the specified interface. If one is not found, raises ComponentLookupError. Nr )� interface�namer r r r � getUtilityG s z!IComponentArchitecture.getUtilityc C s dS )z�Look for the utility that provides interface Returns the nearest utility to the context that implements the specified interface. If one is not found, returns default. Nr )r r! �defaultr r r r �queryUtilityO s z#IComponentArchitecture.queryUtilityc C s dS )z�Query for the next available utility. Find the next available utility providing `interface` and having the specified name. If no utility was found, return the specified `default` value. Nr )r r r! r# r r r �queryNextUtilityV s z'IComponentArchitecture.queryNextUtilityc C s dS )zrGet the next available utility. If no utility was found, a `ComponentLookupError` is raised. Nr )r r r! r r r �getNextUtility^ s z%IComponentArchitecture.getNextUtilityc C s dS )zuReturn the utilities that provide an interface An iterable of utility name-value pairs is returned. Nr �r r r r r �getUtilitiesFord s z&IComponentArchitecture.getUtilitiesForc C s dS )z�Return all registered utilities for an interface This includes overridden utilities. An iterable of utility instances is returned. No names are returned. Nr r'