Skip to content
This repository has been archived by the owner on Feb 12, 2020. It is now read-only.

Commit

Permalink
Rename 'include' to 'resources'
Browse files Browse the repository at this point in the history
  • Loading branch information
janjaapdriessen committed May 13, 2012
1 parent dc2324c commit 3d92daf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/grokcore/resource/directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
import fanstatic.core
import grokcore.resource.interfaces

def validateInclusion(directive, *resources):
def validateResources(directive, *resources):
for resource in resources:
if not isinstance(resource, fanstatic.core.Dependable):
raise ValueError(
'You can only include fanstatic Dependable '
'(Resource or Group) components.')

class include(martian.Directive):
class resources(martian.Directive):
scope = martian.CLASS
store = martian.MULTIPLE
validate = validateInclusion
validate = validateResources

def factory(self, *resources):
zope.interface.declarations.addClassAdvisor(
_resources_advice, depth=3)
return resources

def _resources_advice(cls):
if include.bind().get(cls):
if resources.bind().get(cls):
if not grokcore.resource.interfaces.IResourcesIncluder.implementedBy(
cls):
zope.interface.classImplements(
Expand Down

0 comments on commit 3d92daf

Please sign in to comment.