[Checkins] SVN: grokcore.view/branches/1.13/src/grokcore/view/ Move the view directive from grokcore.view.
Sylvain Viollon
sylvain at infrae.com
Mon Nov 1 11:42:44 EDT 2010
Log message for revision 118055:
Move the view directive from grokcore.view.
Changed:
U grokcore.view/branches/1.13/src/grokcore/view/__init__.py
U grokcore.view/branches/1.13/src/grokcore/view/directive.py
U grokcore.view/branches/1.13/src/grokcore/view/interfaces.py
-=-
Modified: grokcore.view/branches/1.13/src/grokcore/view/__init__.py
===================================================================
--- grokcore.view/branches/1.13/src/grokcore/view/__init__.py 2010-11-01 15:42:21 UTC (rev 118054)
+++ grokcore.view/branches/1.13/src/grokcore/view/__init__.py 2010-11-01 15:42:44 UTC (rev 118055)
@@ -22,7 +22,8 @@
from grokcore.view.components import View, ViewSupport
from grokcore.view.components import PageTemplate, PageTemplateFile
from grokcore.view.components import DirectoryResource
-from grokcore.view.directive import layer, template, templatedir, skin, path
+from grokcore.view.directive import (
+ layer, template, templatedir, skin, path, view)
from grokcore.view.util import url
# Import this module so that it's available as soon as you import the
Modified: grokcore.view/branches/1.13/src/grokcore/view/directive.py
===================================================================
--- grokcore.view/branches/1.13/src/grokcore/view/directive.py 2010-11-01 15:42:21 UTC (rev 118054)
+++ grokcore.view/branches/1.13/src/grokcore/view/directive.py 2010-11-01 15:42:44 UTC (rev 118055)
@@ -19,13 +19,15 @@
from martian.error import GrokImportError
from martian.directive import StoreOnce
from zope.interface.interface import TAGGED_DATA
+from zope.publisher.interfaces.browser import IBrowserView
def validateLocalPath(directive, value):
martian.validateText(directive, value)
if os.path.sep in value:
- raise GrokImportError("The '%s' directive can not contain path separator."
- % directive.name)
+ raise GrokImportError(
+ "The '%s' directive can not contain path separator." %
+ directive.name)
# Define grok directives
@@ -89,3 +91,7 @@
scope = martian.CLASS
store = martian.ONCE
validate = martian.validateText
+
+
+class view(OneInterfaceOrClassOnClassOrModule):
+ default = IBrowserView
Modified: grokcore.view/branches/1.13/src/grokcore/view/interfaces.py
===================================================================
--- grokcore.view/branches/1.13/src/grokcore/view/interfaces.py 2010-11-01 15:42:21 UTC (rev 118054)
+++ grokcore.view/branches/1.13/src/grokcore/view/interfaces.py 2010-11-01 15:42:44 UTC (rev 118055)
@@ -52,7 +52,11 @@
of the directory. This can be overridden using
``templatedir``."""
+ def view(view):
+ """Define on which view a viewlet manager/viewlet is registered.
+ """
+
class IGrokcoreViewAPI(IBaseClasses, IDirectives):
def url(request, obj, name=None, data=None):
More information about the checkins
mailing list