Skip to content

Commit

Permalink
Revert "replace grok.implements() for @grok.implementer()"
Browse files Browse the repository at this point in the history
This reverts commit b3b5b1f. This should've
been on a branch.
  • Loading branch information
janwijbrand committed Jan 17, 2018
1 parent b3b5b1f commit 482e77e
Show file tree
Hide file tree
Showing 25 changed files with 45 additions and 69 deletions.
3 changes: 1 addition & 2 deletions src/grok/ftests/catalog/addform.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ class IMammoth(interface.Interface):
name = schema.TextLine(title=u"Name")
size = schema.TextLine(title=u"Size")

@grok.implementer(IMammoth)
class Mammoth(grok.Model):
pass
grok.implements(IMammoth)

class Index(grok.View):
grok.context(Mammoth)
Expand Down
2 changes: 1 addition & 1 deletion src/grok/ftests/forms/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ class ICowProperties(interface.Interface):
color = schema.TextLine(title=u"Color")


@grok.implementer(ICowProperties)
class Cow(grok.Context):
grok.implements(ICowProperties)
color = u"globally dark"


Expand Down
9 changes: 3 additions & 6 deletions src/grok/ftests/url/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,14 @@ class Second(grok.View):
def render(self):
return self.application_url('second')

@grok.implementer(IMarker)
class Cave(grok.Application, grok.Container):
pass
grok.implements(IMarker)

@grok.implementer(IMarker)
class CaveMan(grok.Model):
pass
grok.implements(IMarker)

@grok.implementer(IMarker)
class Corridors(grok.Container):
pass
grok.implements(IMarker)

class IMammothSkin(IDefaultBrowserLayer):
grok.skin('mammothskin')
Expand Down
5 changes: 2 additions & 3 deletions src/grok/tests/adapter/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ class Cave(grok.Model):
class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.Adapter):
pass
grok.implements(IHome)

class IFireplace(interface.Interface):
pass

@grok.implementer(IFireplace, IHome)
class Fireplace(grok.Adapter):
grok.implements(IFireplace, IHome)
grok.provides(IFireplace)
5 changes: 2 additions & 3 deletions src/grok/tests/adapter/adapterdecorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ class IMoreHome(interface.Interface):
class IYetAnotherHome(interface.Interface):
pass

@grok.implementer(ICave)
class Cave(grok.Model):
grok.implements(ICave)
pass

@grok.implementer(IHome)
class Home(object):
pass
grok.implements(IHome)

@grok.adapter(Cave)
@grok.implementer(IHome)
Expand Down
3 changes: 1 addition & 2 deletions src/grok/tests/adapter/alphabetical.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ class ZCave(grok.Model):
class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.Adapter):
pass
grok.implements(IHome)
2 changes: 1 addition & 1 deletion src/grok/tests/adapter/classcontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ class Club(grok.Model):
class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.Adapter):
grok.implements(IHome)
grok.context(Cave)
2 changes: 1 addition & 1 deletion src/grok/tests/adapter/classcontextimported.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
class IPainting(interface.Interface):
pass

@grok.implementer(IPainting)
class Painting(grok.Adapter):
grok.implements(IPainting)
grok.context(Cave)
3 changes: 1 addition & 2 deletions src/grok/tests/adapter/implementsmany.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ class IHome(interface.Interface):
class IFireplace(interface.Interface):
pass

@grok.implementer(IHome, IFireplace)
class Home(grok.Adapter):
pass
grok.implements(IHome, IFireplace)
2 changes: 1 addition & 1 deletion src/grok/tests/adapter/importedmodel2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
class IPainting(interface.Interface):
pass

@grok.implementer(IPainting)
class Painting(grok.Adapter):
"""
Grokking of this should fail because there's no model (only an
imported one which doesn't count).
"""
grok.implements(IPainting)
8 changes: 3 additions & 5 deletions src/grok/tests/adapter/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,15 @@
class ICave(interface.Interface):
pass

@grok.implementer(ICave)
class Cave(grok.Model):
pass
grok.implements(ICave)

@grok.implementer(ICave)
class Hole(grok.Model):
pass
grok.implements(ICave)

class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.Adapter):
grok.implements(IHome)
grok.context(ICave)
9 changes: 3 additions & 6 deletions src/grok/tests/adapter/interfacemodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,16 @@
class ICave(interface.Interface):
pass

@grok.implementer(ICave)
class Cave(grok.Model):
pass
grok.implements(ICave)

@grok.implementer(ICave)
class Hole(grok.Model):
pass
grok.implements(ICave)

grok.context(ICave)

class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.Adapter):
pass
grok.implements(IHome)
3 changes: 1 addition & 2 deletions src/grok/tests/adapter/modulecontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ class Club(grok.Model):
class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.Adapter):
pass
grok.implements(IHome)
3 changes: 1 addition & 2 deletions src/grok/tests/adapter/modulecontextimported.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@
class IPainting(interface.Interface):
pass

@grok.implementer(IPainting)
class Painting(grok.Adapter):
pass
grok.implements(IPainting)
6 changes: 3 additions & 3 deletions src/grok/tests/adapter/multiadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ class Fireplace(grok.Model):
class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.MultiAdapter):
grok.adapts(Cave, Fireplace)
grok.implements(IHome)

def __init__(self, cave, fireplace):
self.cave = cave
self.fireplace = fireplace

@grok.implementer(IHome)
class Home2(grok.MultiAdapter):
grok.adapts(Cave, Fireplace)
grok.implements(IHome)
grok.name('home2')

def __init__(self, cave, fireplace):
Expand All @@ -80,9 +80,9 @@ def __init__(self, cave, fireplace):
class IFireplace(interface.Interface):
pass

@grok.implementer(IHome, IFireplace)
class Home3(grok.MultiAdapter):
grok.adapts(Cave, Fireplace)
grok.implements(IHome, IFireplace)
grok.provides(IHome)
grok.name('home3')

Expand Down
3 changes: 1 addition & 2 deletions src/grok/tests/adapter/multiadaptsnone.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.MultiAdapter):
pass
grok.implements(IHome)
3 changes: 1 addition & 2 deletions src/grok/tests/adapter/multiple.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ class Club(grok.Model):
class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.Adapter):
pass
grok.implements(IHome)
2 changes: 1 addition & 1 deletion src/grok/tests/adapter/namedadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ class Cave(grok.Model):
class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.Adapter):
grok.implements(IHome)
grok.name('home')
3 changes: 1 addition & 2 deletions src/grok/tests/adapter/nomodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.Adapter):
pass
grok.implements(IHome)
2 changes: 1 addition & 1 deletion src/grok/tests/adapter/oldstyleclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class Cave:
class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.Adapter):
grok.implements(IHome)
grok.context(Cave)
3 changes: 1 addition & 2 deletions src/grok/tests/adapter/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
class IHome(interface.Interface):
pass

@grok.implementer(IHome)
class Home(grok.Adapter):
pass
grok.implements(IHome)

class Cave(grok.Model):
pass
6 changes: 2 additions & 4 deletions src/grok/tests/directive/multipletimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ class IClub(interface.Interface):
class ICave(interface.Interface):
pass

@grok.implementer(IClub)
class Club(object):
pass
grok.implements(IClub)

@grok.implementer(ICave)
class Cave(object):
pass
grok.implements(ICave)

grok.global_utility(Club, provides=IClub, name='foo')
grok.global_utility(Cave)
3 changes: 1 addition & 2 deletions src/grok/tests/utility/implementsmany.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ class IClub(interface.Interface):
class ISpikyClub(interface.Interface):
pass

@grok.implementer(IClub, ISpikyClub)
class Club(grok.GlobalUtility):
pass
grok.implements(IClub, ISpikyClub)
4 changes: 2 additions & 2 deletions src/grok/tests/utility/implementsmany2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class IClub(interface.Interface):
class ISpikyClub(interface.Interface):
pass

@grok.implementer(IClub, ISpikyClub)
class Club(object):
pass
grok.implements(IClub, ISpikyClub)

grok.global_utility(Club)

20 changes: 9 additions & 11 deletions src/grok/tests/utility/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,31 +145,31 @@ class INightClub(interface.Interface):
class IClubMaker(interface.Interface):
pass

@grok.implementer(IClub)
class NormalClub(grok.GlobalUtility):
pass
grok.implements(IClub)

@grok.implementer(IClub)
class HugeClub(grok.GlobalUtility):
grok.implements(IClub)
grok.name('huge')

@grok.implementer(ISpikyClub)
class SpikyClub(grok.GlobalUtility):
grok.implements(ISpikyClub)
grok.provides(IClub)
grok.name('spiky')

@grok.implementer(INightClub, ISpikyClub)
class NightClub(grok.GlobalUtility):
grok.implements(INightClub, ISpikyClub)
grok.provides(INightClub)

@grok.implementer(ISmallClub, ITinyClub)
class SmallClub(grok.GlobalUtility):
grok.implements(ISmallClub, ITinyClub)
grok.provides(ISmallClub)
grok.name('tiny')


@interface.provider(IClubMaker)
@grok.implementer(IClub)
class ClubMaker(grok.GlobalUtility):
grok.implements(IClub)
grok.direct()
grok.name('maker')

Expand All @@ -179,13 +179,11 @@ class IFireplace(interface.Interface):
class IHome(interface.Interface):
pass

@grok.implementer(IFireplace)
class Fireplace(object):
pass
grok.implements(IFireplace)

@grok.implementer(IFireplace, IHome)
class Home(object):
pass
grok.implements(IFireplace, IHome)

grok.global_utility(Fireplace)
grok.global_utility(Fireplace, name='hot')
Expand Down

0 comments on commit 482e77e

Please sign in to comment.