Mercurial > public > mercurial-scm > hg
comparison mercurial/thirdparty/zope/interface/__init__.py @ 37178:68ee61822182
thirdparty: port zope.interface to relative imports
By using relative imports, we're guaranteed to get modules
vendored with Mercurial rather than other random modules
that might be in sys.path.
My editor strips trailing whitespace on save. So some minor
source code cleanup was also performed as part of this commit.
# no-check-commit because some modified lines have double newlines
Differential Revision: https://phab.mercurial-scm.org/D2930
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 21 Mar 2018 19:52:30 -0700 |
parents | 943d77fc07a3 |
children |
comparison
equal
deleted
inserted
replaced
37177:338367d44d34 | 37178:68ee61822182 |
---|---|
46 | 46 |
47 o `verify` has utilities for verifying implementations of interfaces. | 47 o `verify` has utilities for verifying implementations of interfaces. |
48 | 48 |
49 See the module doc strings for more information. | 49 See the module doc strings for more information. |
50 """ | 50 """ |
51 | |
52 from __future__ import absolute_import | |
53 | |
51 __docformat__ = 'restructuredtext' | 54 __docformat__ = 'restructuredtext' |
52 | 55 |
53 from zope.interface.interface import Interface | 56 from .interface import Interface |
54 from zope.interface.interface import _wire | 57 from .interface import _wire |
55 | 58 |
56 # Need to actually get the interface elements to implement the right interfaces | 59 # Need to actually get the interface elements to implement the right interfaces |
57 _wire() | 60 _wire() |
58 del _wire | 61 del _wire |
59 | 62 |
60 from zope.interface.declarations import Declaration | 63 from .declarations import Declaration |
61 from zope.interface.declarations import alsoProvides | 64 from .declarations import alsoProvides |
62 from zope.interface.declarations import classImplements | 65 from .declarations import classImplements |
63 from zope.interface.declarations import classImplementsOnly | 66 from .declarations import classImplementsOnly |
64 from zope.interface.declarations import classProvides | 67 from .declarations import classProvides |
65 from zope.interface.declarations import directlyProvidedBy | 68 from .declarations import directlyProvidedBy |
66 from zope.interface.declarations import directlyProvides | 69 from .declarations import directlyProvides |
67 from zope.interface.declarations import implementedBy | 70 from .declarations import implementedBy |
68 from zope.interface.declarations import implementer | 71 from .declarations import implementer |
69 from zope.interface.declarations import implementer_only | 72 from .declarations import implementer_only |
70 from zope.interface.declarations import implements | 73 from .declarations import implements |
71 from zope.interface.declarations import implementsOnly | 74 from .declarations import implementsOnly |
72 from zope.interface.declarations import moduleProvides | 75 from .declarations import moduleProvides |
73 from zope.interface.declarations import named | 76 from .declarations import named |
74 from zope.interface.declarations import noLongerProvides | 77 from .declarations import noLongerProvides |
75 from zope.interface.declarations import providedBy | 78 from .declarations import providedBy |
76 from zope.interface.declarations import provider | 79 from .declarations import provider |
77 from zope.interface.exceptions import Invalid | 80 from .exceptions import Invalid |
78 from zope.interface.interface import Attribute | 81 from .interface import Attribute |
79 from zope.interface.interface import invariant | 82 from .interface import invariant |
80 from zope.interface.interface import taggedValue | 83 from .interface import taggedValue |
81 | 84 |
82 # The following are to make spec pickles cleaner | 85 # The following are to make spec pickles cleaner |
83 from zope.interface.declarations import Provides | 86 from .declarations import Provides |
84 | 87 |
85 | 88 |
86 from zope.interface.interfaces import IInterfaceDeclaration | 89 from .interfaces import IInterfaceDeclaration |
87 | 90 |
88 moduleProvides(IInterfaceDeclaration) | 91 moduleProvides(IInterfaceDeclaration) |
89 | 92 |
90 __all__ = ('Interface', 'Attribute') + tuple(IInterfaceDeclaration) | 93 __all__ = ('Interface', 'Attribute') + tuple(IInterfaceDeclaration) |