Skip to content

Commit

Permalink
Replace implements for implementer (#9)
Browse files Browse the repository at this point in the history
* ignore coverage artefacts

* Replace the use of `grok.implements()` with the `@grok.implementer()` directive throughout.
  • Loading branch information
janwijbrand committed Jan 17, 2018
1 parent a03f0c2 commit 6a063da
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .gitignore
@@ -1,8 +1,9 @@
*.pyc
__pycache__
.coverage
.coverage.*
.installed.cfg
.tox/
__pycache__
*.pyc
bin
develop-eggs
htmlcov/
Expand Down
4 changes: 2 additions & 2 deletions CHANGES.txt
Expand Up @@ -4,8 +4,8 @@ Changes
3.0.1 (unreleased)
------------------

- Nothing changed yet.

- Replace the use of `grok.implements()` with the `@grok.implementer()`
directive throughout.

3.0.0 (2018-01-12)
------------------
Expand Down
2 changes: 1 addition & 1 deletion src/grokcore/annotation/tests/annotation/annotation.py
Expand Up @@ -86,8 +86,8 @@ def addBrand(brand):
def getBrands():
"""Return a list of brands."""

@grok.implementer(IBranding)
class Branding(grok.Annotation):
grok.implements(IBranding)

def __init__(self):
self._brands = OOTreeSet()
Expand Down
3 changes: 2 additions & 1 deletion src/grokcore/annotation/tests/annotation/implementsmany.py
Expand Up @@ -21,5 +21,6 @@ class IOneInterface(interface.Interface):
class IAnotherInterface(interface.Interface):
pass

@grok.implementer(IOneInterface, IAnotherInterface)
class MammothAnnotations(grok.Annotation):
grok.implements(IOneInterface, IAnotherInterface)
pass
6 changes: 3 additions & 3 deletions src/grokcore/annotation/tests/annotation/lazy.py
Expand Up @@ -117,8 +117,8 @@ class ILazy(interface.Interface):
readonly=True)


@grok.implementer(ILazy)
class Lazy(grok.LazyAnnotation):
grok.implements(ILazy)
grok.name('lazy.annotation.custom.name')
grok.provides(ILazy)

Expand All @@ -141,8 +141,8 @@ class _IFauxLazy(interface.Interface):
pass


@grok.implementer(_IFauxLazy)
class FauxLazy(grok.LazyAnnotation):
grok.implements(_IFauxLazy)
grok.provides(_IFauxLazy)

testing = grok.LazyAnnotationProperty(_FauxField(), 'testing')
Expand All @@ -153,8 +153,8 @@ class IIncorrect(interface.Interface):
testing = schema.TextLine(title=u'testing')


@grok.implementer(IIncorrect)
class IncorrectAnnotation(grok.Annotation):
grok.implements(IIncorrect)
grok.provides(IIncorrect)

testing = grok.LazyAnnotationProperty(IIncorrect['testing'])
5 changes: 3 additions & 2 deletions src/grokcore/annotation/tests/annotation/name.py
Expand Up @@ -52,10 +52,11 @@ class IImplicitName(interface.Interface):
pass


@grok.implementer(IExplicitName)
class ExplicitName(grok.Annotation):
grok.implements(IExplicitName)
grok.name('mammoth.branding')


@grok.implementer(IImplicitName)
class ImplicitName(grok.Annotation):
grok.implements(IImplicitName)
pass
2 changes: 1 addition & 1 deletion src/grokcore/annotation/tests/annotation/provides.py
Expand Up @@ -35,6 +35,6 @@ class IAnotherOne(interface.Interface):
pass


@grok.implementer(IOneInterface, IAnotherOne)
class MammothAnnotation(grok.Annotation):
grok.implements(IOneInterface, IAnotherOne)
grok.provides(IOneInterface)

0 comments on commit 6a063da

Please sign in to comment.