ok
Direktori : /usr/lib64/python3.6/site-packages/zope/interface/__pycache__/ |
Current File : //usr/lib64/python3.6/site-packages/zope/interface/__pycache__/declarations.cpython-36.pyc |
3 ��[e{ � @ s� d Z dZddlZddlmZ ddlmZ ddlmZ ddlZddlm Z ddl mZ dd l mZ dd l m Z ddlmZ ddlmZ i Zd ZdZG dd� de�ZG dd� de �ZG dd� de�Zdd� Zdd� ZeZdd� Zdd� Zdd� ZG dd � d e�ZG d!d"� d"e�Z d#d$� Z!d%d&� Z"d'd(� Z#G d)d*� d*e�Z$e$Z%ej&� Z'd+d*� Z$d,e$_(d-d.� Z)d/d0� Z*d1d2� Z+G d3d4� d4e�Z,e,Z-e,Z.yddl/Z0W n e1k �r� Y nX dd5l/m.Z. G d6d7� d7ee.�Z2d8d9� Z3d:d;� Z4d<d=� Z5G d>d?� d?e�Z6d@dA� Z7dBdC� Z8dDdE� Z9e9Z:dFdG� Z;e;Z<G dHdI� dIe�Z=e=Z>dPdJdK�Z?e� Z@yddl/Z0W n e1k �rV Y n2X ddLl/mZ ddMl/m<Z< ddNl/m:Z: ddOl/m>Z> e>� ZAdS )Qa� Implementation of interface declarations There are three flavors of declarations: - Declarations are used to simply name declared interfaces. - ImplementsDeclarations are used to express the interfaces that a class implements (that instances of the class provides). Implements specifications support inheriting interfaces. - ProvidesDeclarations are used to express interfaces directly provided by objects. Zrestructuredtext� N)�FunctionType)� MethodType)� ModuleType)�addClassAdvisor)�InterfaceClass)�SpecificationBase)� Specification)�CLASS_TYPES)�PYTHON3zIClass advice impossible in Python3. Use the @%s class decorator instead.z\The %s API is deprecated, and will not work in Python3 Use the @%s class decorator instead.c @ s e Zd Zdd� Zdd� ZdS )�namedc C s || _ d S )N)�name)�selfr � r �$/usr/lib64/python3.6/declarations.py�__init__5 s znamed.__init__c C s | j |_|S )N)r Z__component_name__)r �obr r r �__call__8 s znamed.__call__N)�__name__� __module__�__qualname__r r r r r r r 3 s r c @ sL e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z e ZdS )�DeclarationzInterface declarationsc G s t j| t|�� d S )N)r r �_normalizeargs)r � interfacesr r r r ? s zDeclaration.__init__c C s. t j| |� y| `W n tk r( Y nX d S )N)r �changedZ_v_attrs�AttributeError)r Zoriginally_changedr r r r B s zDeclaration.changedc C s | j |�o|| j� kS )z:Test whether an interface is in the specification )�extendsr )r � interfacer r r �__contains__I s zDeclaration.__contains__c C s | j � S )zCReturn an iterator for the interfaces in the specification )r )r r r r �__iter__O s zDeclaration.__iter__c C s t | j�S )zCReturn an iterator of all included and extended interfaces )�iterZ__iro__)r r r r � flattenedT s zDeclaration.flattenedc s t � fdd�| j� D �� S )z/Remove interfaces from a specification c s&