[Checkins] SVN: grok/branches/jw-philipp-using-ndir-directives/
martian.ndir has been renamed and exposed by the martian module,
therefore import the new-style directive stuff from martian directly
Philipp von Weitershausen
philikon at philikon.de
Sat May 3 08:26:45 EDT 2008
Log message for revision 86202:
martian.ndir has been renamed and exposed by the martian module, therefore import the new-style directive stuff from martian directly
Changed:
U grok/branches/jw-philipp-using-ndir-directives/buildout.cfg
U grok/branches/jw-philipp-using-ndir-directives/src/grok/__init__.py
U grok/branches/jw-philipp-using-ndir-directives/src/grok/directive.py
-=-
Modified: grok/branches/jw-philipp-using-ndir-directives/buildout.cfg
===================================================================
--- grok/branches/jw-philipp-using-ndir-directives/buildout.cfg 2008-05-03 12:25:06 UTC (rev 86201)
+++ grok/branches/jw-philipp-using-ndir-directives/buildout.cfg 2008-05-03 12:26:44 UTC (rev 86202)
@@ -1,10 +1,14 @@
[buildout]
-develop = . grokdocs grokwiki
+develop = . grokdocs grokwiki martian grokcore.component
parts = docs interpreter grokwiki zopectl data test
find-links = http://download.zope.org/distribution/
extends = versions.cfg
versions = versions
+[versions]
+martian = 0.9.4dev
+grokcore.component = 1.1dev
+
[docs]
recipe = zc.recipe.egg
eggs = grokdocs
Modified: grok/branches/jw-philipp-using-ndir-directives/src/grok/__init__.py
===================================================================
--- grok/branches/jw-philipp-using-ndir-directives/src/grok/__init__.py 2008-05-03 12:25:06 UTC (rev 86201)
+++ grok/branches/jw-philipp-using-ndir-directives/src/grok/__init__.py 2008-05-03 12:26:44 UTC (rev 86202)
@@ -44,7 +44,7 @@
from grok.interfaces import IRESTSkinType
from grok.components import ViewletManager, Viewlet
-from martian.ndir import baseclass
+from martian import baseclass
from grokcore.component.directive import (
context, name, title, provides, global_utility, direct, order)
from grok.directive import (
Modified: grok/branches/jw-philipp-using-ndir-directives/src/grok/directive.py
===================================================================
--- grok/branches/jw-philipp-using-ndir-directives/src/grok/directive.py 2008-05-03 12:25:06 UTC (rev 86201)
+++ grok/branches/jw-philipp-using-ndir-directives/src/grok/directive.py 2008-05-03 12:26:44 UTC (rev 86202)
@@ -18,6 +18,7 @@
from zope.interface.interfaces import IInterface
from zope.publisher.interfaces.browser import IBrowserView
+import martian
from martian.error import GrokImportError
from martian.directive import (Directive, OnceDirective,
MultipleTimesDirective, BaseTextDirective,
@@ -31,7 +32,6 @@
ClassDirectiveContext,
ClassOrModuleDirectiveContext)
from martian import util
-from martian import ndir
from grok import components
class MultiValueOnceDirective(OnceDirective):
@@ -101,26 +101,34 @@
# Define grok directives
-template = SingleTextDirective('grok.template', ClassDirectiveContext())
-templatedir = SingleTextDirective('grok.templatedir', ModuleDirectiveContext())
+class template(martian.Directive):
+ scope = martian.CLASS
+ store = martian.ONCE
+ validate = martian.validateText
+
+class templatedir(martian.Directive):
+ scope = martian.MODULE
+ store = martian.ONCE
+ validate = martian.validateText
+
local_utility = LocalUtilityDirective('grok.local_utility',
ClassDirectiveContext())
require = RequireDirective('grok.require', ClassDirectiveContext())
site = InterfaceOrClassDirective('grok.site',
ClassDirectiveContext())
-class permissions(ndir.Directive):
- scope = ndir.CLASS
- store = ndir.ONCE
+class permissions(martian.Directive):
+ scope = martian.CLASS
+ store = martian.ONCE
default = []
def factory(*args):
return args
-class OneInterfaceOrClassOnClassOrModule(ndir.Directive):
- scope = ndir.CLASS_OR_MODULE
- store = ndir.ONCE
- validate = ndir.validateInterfaceOrClass
+class OneInterfaceOrClassOnClassOrModule(martian.Directive):
+ scope = martian.CLASS_OR_MODULE
+ store = martian.ONCE
+ validate = martian.validateInterfaceOrClass
class layer(OneInterfaceOrClassOnClassOrModule):
pass
@@ -131,9 +139,9 @@
class view(OneInterfaceOrClassOnClassOrModule):
default = IBrowserView
-class traversable(ndir.Directive):
- scope = ndir.CLASS
- store = ndir.DICT
+class traversable(martian.Directive):
+ scope = martian.CLASS
+ store = martian.DICT
def factory(self, attr, name=None):
if name is None:
More information about the Checkins
mailing list