Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1############################################################################## 

2# 

3# Copyright (c) 2001, 2002 Zope Foundation and Contributors. 

4# All Rights Reserved. 

5# 

6# This software is subject to the provisions of the Zope Public License, 

7# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. 

8# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED 

9# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 

10# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS 

11# FOR A PARTICULAR PURPOSE. 

12# 

13############################################################################## 

14"""Interfaces 

15 

16This package implements the Python "scarecrow" proposal. 

17 

18The package exports two objects, `Interface` and `Attribute` directly. It also 

19exports several helper methods. Interface is used to create an interface with 

20a class statement, as in: 

21 

22 class IMyInterface(Interface): 

23 '''Interface documentation 

24 ''' 

25 

26 def meth(arg1, arg2): 

27 '''Documentation for meth 

28 ''' 

29 

30 # Note that there is no self argument 

31 

32To find out what you can do with interfaces, see the interface 

33interface, `IInterface` in the `interfaces` module. 

34 

35The package has several public modules: 

36 

37 o `declarations` provides utilities to declare interfaces on objects. It 

38 also provides a wide range of helpful utilities that aid in managing 

39 declared interfaces. Most of its public names are however imported here. 

40 

41 o `document` has a utility for documenting an interface as structured text. 

42 

43 o `exceptions` has the interface-defined exceptions 

44 

45 o `interfaces` contains a list of all public interfaces for this package. 

46 

47 o `verify` has utilities for verifying implementations of interfaces. 

48 

49See the module doc strings for more information. 

50""" 

51__docformat__ = 'restructuredtext' 

52# pylint:disable=wrong-import-position,unused-import 

53from zope.interface.interface import Interface 

54from zope.interface.interface import _wire 

55 

56# Need to actually get the interface elements to implement the right interfaces 

57_wire() 

58del _wire 

59 

60from zope.interface.declarations import Declaration 

61from zope.interface.declarations import alsoProvides 

62from zope.interface.declarations import classImplements 

63from zope.interface.declarations import classImplementsFirst 

64from zope.interface.declarations import classImplementsOnly 

65from zope.interface.declarations import classProvides 

66from zope.interface.declarations import directlyProvidedBy 

67from zope.interface.declarations import directlyProvides 

68from zope.interface.declarations import implementedBy 

69from zope.interface.declarations import implementer 

70from zope.interface.declarations import implementer_only 

71from zope.interface.declarations import implements 

72from zope.interface.declarations import implementsOnly 

73from zope.interface.declarations import moduleProvides 

74from zope.interface.declarations import named 

75from zope.interface.declarations import noLongerProvides 

76from zope.interface.declarations import providedBy 

77from zope.interface.declarations import provider 

78 

79from zope.interface.exceptions import Invalid 

80 

81from zope.interface.interface import Attribute 

82from zope.interface.interface import interfacemethod 

83from zope.interface.interface import invariant 

84from zope.interface.interface import taggedValue 

85 

86# The following are to make spec pickles cleaner 

87from zope.interface.declarations import Provides 

88 

89 

90from zope.interface.interfaces import IInterfaceDeclaration 

91 

92moduleProvides(IInterfaceDeclaration) 

93 

94__all__ = ('Interface', 'Attribute') + tuple(IInterfaceDeclaration) 

95 

96assert all(k in globals() for k in __all__)