[Checkins] SVN: megrok.layout/trunk/ Remove CodePage
Souheil CHELFOUH
souheil at chelfouh.com
Mon Oct 18 05:58:48 EDT 2010
Log message for revision 117656:
Remove CodePage
Changed:
U megrok.layout/trunk/buildout.cfg
U megrok.layout/trunk/docs/HISTORY.txt
U megrok.layout/trunk/setup.py
U megrok.layout/trunk/src/megrok/layout/README.txt
U megrok.layout/trunk/src/megrok/layout/__init__.py
U megrok.layout/trunk/src/megrok/layout/components.py
U megrok.layout/trunk/src/megrok/layout/ftests/test_layoutlayers.py
U megrok.layout/trunk/src/megrok/layout/ftests/test_page.py
U megrok.layout/trunk/src/megrok/layout/ftests/test_specializedlayout.py
U megrok.layout/trunk/src/megrok/layout/interfaces.py
U megrok.layout/trunk/src/megrok/layout/tests/test_norenderortemplatelayout.py
D megrok.layout/trunk/versions.cfg
-=-
Modified: megrok.layout/trunk/buildout.cfg
===================================================================
--- megrok.layout/trunk/buildout.cfg 2010-10-18 09:58:42 UTC (rev 117655)
+++ megrok.layout/trunk/buildout.cfg 2010-10-18 09:58:48 UTC (rev 117656)
@@ -1,9 +1,12 @@
[buildout]
develop = .
parts = interpreter test
-extends = versions.cfg
+extends = http://grok.zope.org/releaseinfo/grok-1.0b1.cfg
versions = versions
+[versions]
+grokcore.view = 1.12.1
+
[interpreter]
recipe = zc.recipe.egg
eggs = megrok.layout
Modified: megrok.layout/trunk/docs/HISTORY.txt
===================================================================
--- megrok.layout/trunk/docs/HISTORY.txt 2010-10-18 09:58:42 UTC (rev 117655)
+++ megrok.layout/trunk/docs/HISTORY.txt 2010-10-18 09:58:48 UTC (rev 117656)
@@ -1,6 +1,13 @@
Changelog
=========
+0.8 (2009-09-17)
+----------------
+
+- Remove the CodePage, since CodeView have been removed from
+ grokcore.view.
+ [sylvain]
+
0.7 (2009-09-15)
----------------
Modified: megrok.layout/trunk/setup.py
===================================================================
--- megrok.layout/trunk/setup.py 2010-10-18 09:58:42 UTC (rev 117655)
+++ megrok.layout/trunk/setup.py 2010-10-18 09:58:48 UTC (rev 117656)
@@ -5,10 +5,8 @@
long_description = open(readme_filename).read() + '\n\n' + \
open(os.path.join('docs', 'HISTORY.txt')).read()
-
-
setup(name='megrok.layout',
- version='0.7',
+ version='0.8',
description="A layout component package for zope3 and Grok.",
long_description = long_description,
classifiers=[
@@ -30,12 +28,9 @@
include_package_data=True,
zip_safe=False,
install_requires=[
- 'setuptools',
- 'grokcore.component',
- 'grokcore.view >= 1.9',
- 'grokcore.formlib',
- ],
- entry_points="""
- # -*- Entry points: -*-
- """,
+ 'setuptools',
+ 'grokcore.component',
+ 'grokcore.view >= 1.12.1',
+ 'grokcore.formlib',
+ ],
)
Modified: megrok.layout/trunk/src/megrok/layout/README.txt
===================================================================
--- megrok.layout/trunk/src/megrok/layout/README.txt 2010-10-18 09:58:42 UTC (rev 117655)
+++ megrok.layout/trunk/src/megrok/layout/README.txt 2010-10-18 09:58:48 UTC (rev 117656)
@@ -58,16 +58,15 @@
Now let's see how to use this Layout in a specific context using a Page.
-Page and CodePage
-=================
+Page
+====
-The Page is the specific code that you want to control. It is based on
-the grokcore.view.View browser page implementation and therefore
-provides a 'update' method, and a 'content' method that will return
-the specific HTML code generated by the template. If you don't whish
-to use a template, you can use a CodePage, in that case the 'content'
-method will return the result of the 'render' that you have to
-define. That last one works like grokcore.view.CodeView.
+The page is the specific code that you want to control. It is based on
+the grokcore.View browser page implementation and therefore provides a
+``render`` and ``update`` method. The ``render`` method will simply
+return the specific HTML code generated by the template or the
+``render`` method code while ``__call__`` will lookup for a Layout
+component and renders itself inside it.
First, we'll create 2 models that will serve as exemples.
@@ -79,8 +78,8 @@
Let's create now a page that will display their description.
- >>> from megrok.layout import CodePage
- >>> class AnimalDisplay(CodePage):
+ >>> from megrok.layout import Page
+ >>> class AnimalDisplay(Page):
... grok.name('display')
... grok.context(Interface)
...
Modified: megrok.layout/trunk/src/megrok/layout/__init__.py
===================================================================
--- megrok.layout/trunk/src/megrok/layout/__init__.py 2010-10-18 09:58:42 UTC (rev 117655)
+++ megrok.layout/trunk/src/megrok/layout/__init__.py 2010-10-18 09:58:48 UTC (rev 117656)
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
-from megrok.layout.interfaces import ILayout, IPage, ICodePage
-from megrok.layout.components import Layout, Page, CodePage, Form
+from megrok.layout.interfaces import ILayout, IPage
+from megrok.layout.components import Layout, Page, Form
Modified: megrok.layout/trunk/src/megrok/layout/components.py
===================================================================
--- megrok.layout/trunk/src/megrok/layout/components.py 2010-10-18 09:58:42 UTC (rev 117655)
+++ megrok.layout/trunk/src/megrok/layout/components.py 2010-10-18 09:58:48 UTC (rev 117656)
@@ -6,7 +6,7 @@
import grokcore.component as grok
from zope.interface import Interface
from zope.publisher.publish import mapply
-from megrok.layout.interfaces import IPage, ICodePage, ILayout
+from megrok.layout.interfaces import IPage, ILayout
class Layout(object):
@@ -61,12 +61,14 @@
return self.render()
-class BasePage(object):
- """A base page class.
+class Page(grokcore.view.View):
+ """A view class.
"""
+ grok.baseclass()
+ grok.implements(IPage)
def __init__(self, context, request):
- super(BasePage, self).__init__(context, request)
+ super(Page, self).__init__(context, request)
self.layout = None
def __call__(self):
@@ -79,32 +81,15 @@
(self.request, self.context), ILayout)
return self.layout(self)
-
-class Page(BasePage, grokcore.view.View):
- """A view class.
- """
- grok.baseclass()
- grok.implements(IPage)
-
def default_namespace(self):
namespace = super(Page, self).default_namespace()
namespace['layout'] = self.layout
return namespace
def content(self):
- return self.template.render(self)
-
-
-class CodePage(BasePage, grokcore.view.CodeView):
- """A code view class.
- """
- grok.baseclass()
- grok.implements(ICodePage)
-
- def render(self):
- raise NotImplementedError
-
- def content(self):
+ template = getattr(self, 'template', None)
+ if template is not None:
+ return self._render_template()
return mapply(self.render, (), self.request)
Modified: megrok.layout/trunk/src/megrok/layout/ftests/test_layoutlayers.py
===================================================================
--- megrok.layout/trunk/src/megrok/layout/ftests/test_layoutlayers.py 2010-10-18 09:58:42 UTC (rev 117655)
+++ megrok.layout/trunk/src/megrok/layout/ftests/test_layoutlayers.py 2010-10-18 09:58:48 UTC (rev 117656)
@@ -24,7 +24,7 @@
from grokcore.view import layer, skin
from zope import interface
-from megrok.layout import Layout, Page, CodePage
+from megrok.layout import Layout, Page
from grokcore.view import IDefaultBrowserLayer
@@ -79,14 +79,14 @@
return "<div> B Layout </div>"
-class MyView(CodePage):
+class MyView(Page):
grok.context(interface.Interface)
def render(self):
return "MYVIEW"
-class MyViewB(CodePage):
+class MyViewB(Page):
grok.context(interface.Interface)
layer(MySkinLayer)
Modified: megrok.layout/trunk/src/megrok/layout/ftests/test_page.py
===================================================================
--- megrok.layout/trunk/src/megrok/layout/ftests/test_page.py 2010-10-18 09:58:42 UTC (rev 117655)
+++ megrok.layout/trunk/src/megrok/layout/ftests/test_page.py 2010-10-18 09:58:48 UTC (rev 117656)
@@ -28,7 +28,7 @@
from grokcore.view import templatedir
from zope import interface
-from megrok.layout import Layout, Page, CodePage
+from megrok.layout import Layout, Page
templatedir('templates')
@@ -42,7 +42,7 @@
grok.context(Cow)
-class MyView(CodePage):
+class MyView(Page):
grok.context(interface.Interface)
def render(self):
Modified: megrok.layout/trunk/src/megrok/layout/ftests/test_specializedlayout.py
===================================================================
--- megrok.layout/trunk/src/megrok/layout/ftests/test_specializedlayout.py 2010-10-18 09:58:42 UTC (rev 117655)
+++ megrok.layout/trunk/src/megrok/layout/ftests/test_specializedlayout.py 2010-10-18 09:58:48 UTC (rev 117656)
@@ -28,7 +28,7 @@
from grokcore.view import layer, skin
from zope import interface
-from megrok.layout import Layout, Page, CodePage
+from megrok.layout import Layout, Page
from grokcore.view import IDefaultBrowserLayer
@@ -85,7 +85,7 @@
return "<div> Layout B for context Two </div>"
-class MyView(CodePage):
+class MyView(Page):
grok.context(interface.Interface)
grok.layer(IALayer)
Modified: megrok.layout/trunk/src/megrok/layout/interfaces.py
===================================================================
--- megrok.layout/trunk/src/megrok/layout/interfaces.py 2010-10-18 09:58:42 UTC (rev 117655)
+++ megrok.layout/trunk/src/megrok/layout/interfaces.py 2010-10-18 09:58:48 UTC (rev 117656)
@@ -5,26 +5,15 @@
class ILayout(Interface):
- """Layout code.
+ """Layout view.
"""
-class IPageAware(Interface):
- """A view which is able to use a layout to render itself.
+class IPage(interfaces.IGrokView):
+ """A view using a layout to render itself.
"""
- def contents():
- """Return the content of the page to be included in the
- layout.
+ def content():
+ """Give you back the result of your Page to be included inside
+ the layout.
"""
-
-
-class IPage(IPageAware, interfaces.IGrokView):
- """A template using a layout to render itself.
- """
-
-
-class ICodePage(IPage):
- """A template using a layout to render itself.
- """
-
Modified: megrok.layout/trunk/src/megrok/layout/tests/test_norenderortemplatelayout.py
===================================================================
--- megrok.layout/trunk/src/megrok/layout/tests/test_norenderortemplatelayout.py 2010-10-18 09:58:42 UTC (rev 117655)
+++ megrok.layout/trunk/src/megrok/layout/tests/test_norenderortemplatelayout.py 2010-10-18 09:58:48 UTC (rev 117656)
@@ -2,8 +2,8 @@
>>> grok.testing.grok(__name__)
Traceback (most recent call last):
...
- ConfigurationExecutionError: martian.error.GrokError: View <class 'megrok.layout.tests.test_norenderortemplatelayout.MyLayout'> has no associated template.
- in:
+ ConfigurationExecutionError: martian.error.GrokError: View <class 'megrok.layout.tests.test_norenderortemplatelayout.MyLayout'> has no associated template or 'render' method.
+ in:
<BLANKLINE>
"""
Deleted: megrok.layout/trunk/versions.cfg
===================================================================
--- megrok.layout/trunk/versions.cfg 2010-10-18 09:58:42 UTC (rev 117655)
+++ megrok.layout/trunk/versions.cfg 2010-10-18 09:58:48 UTC (rev 117656)
@@ -1,111 +0,0 @@
-[versions]
-ClientForm = 0.2.9
-grokcore.component = 1.7
-grokcore.formlib = 1.2
-grokcore.security = 1.2
-grokcore.view = 1.11
-grokcore.viewlet = 1.1
-grokui.admin = 0.4.0
-martian = 0.11
-mechanize = 0.1.7b
-pytz = 2007k
-RestrictedPython = 3.4.2
-simplejson = 1.7.1
-z3c.autoinclude = 0.2.2
-z3c.flashmessage = 1.0
-z3c.recipe.eggbasket = 0.4.3
-z3c.testsetup = 0.4
-zc.catalog = 1.2.0
-ZConfig = 2.5.1
-zc.recipe.testrunner = 1.0.0
-zdaemon = 2.0.2
-ZODB3 = 3.8.3
-zodbcode = 3.4.0
-zope.annotation = 3.4.1
-zope.app.apidoc = 3.4.3
-zope.app.applicationcontrol = 3.4.3
-zope.app.appsetup = 3.4.1
-zope.app.authentication = 3.4.4
-zope.app.basicskin = 3.4.0
-zope.app.broken = 3.4.0
-zope.app.catalog = 3.5.1
-zope.app.component = 3.4.1
-zope.app.container = 3.5.6
-zope.app.content = 3.4.0
-zope.app.debug = 3.4.1
-zope.app.dependable = 3.4.0
-zope.app.error = 3.5.1
-zope.app.exception = 3.4.1
-zope.app.file = 3.4.4
-zope.app.folder = 3.4.0
-zope.app.form = 3.4.1
-zope.app.generations = 3.4.1
-zope.app.http = 3.4.1
-zope.app.i18n = 3.4.4
-zope.app.interface = 3.4.0
-zope.app.intid = 3.4.1
-zope.app.keyreference = 3.4.1
-zope.app.locales = 3.4.5
-zope.app.onlinehelp = 3.4.1
-zope.app.pagetemplate = 3.4.1
-zope.app.preference = 3.4.1
-zope.app.principalannotation = 3.4.0
-zope.app.publication = 3.4.3
-zope.app.publisher = 3.5.1
-zope.app.renderer = 3.4.0
-zope.app.rotterdam = 3.4.1
-zope.app.schema = 3.4.0
-zope.app.security = 3.5.2
-zope.app.securitypolicy = 3.4.6
-zope.app.server = 3.4.2
-zope.app.session = 3.5.1
-zope.app.skins = 3.4.0
-zope.app.testing = 3.4.3
-zope.app.tree = 3.4.0
-zope.app.twisted = 3.4.1
-zope.app.wsgi = 3.4.2
-zope.app.zapi = 3.4.0
-zope.app.zcmlfiles = 3.4.3
-zope.app.zopeappgenerations = 3.4.0
-zope.cachedescriptors = 3.4.1
-zope.component = 3.4.0
-zope.configuration = 3.4.0
-zope.contentprovider = 3.4.0
-zope.contenttype = 3.4.0
-zope.copypastemove = 3.4.0
-zope.datetime = 3.4.0
-zope.deferredimport = 3.4.0
-zope.deprecation = 3.4.0
-zope.dottedname = 3.4.2
-zope.dublincore = 3.4.0
-zope.error = 3.5.1
-zope.event = 3.4.0
-zope.exceptions = 3.4.0
-zope.filerepresentation = 3.4.0
-zope.formlib = 3.4.0
-zope.hookable = 3.4.0
-zope.i18n = 3.4.0
-zope.i18nmessageid = 3.4.3
-zope.index = 3.4.1
-zope.interface = 3.4.1
-zope.lifecycleevent = 3.4.0
-zope.location = 3.4.0
-zope.minmax = 1.1.0
-zope.modulealias = 3.4.0
-zope.pagetemplate = 3.4.0
-zope.proxy = 3.4.2
-zope.publisher = 3.4.9
-zope.schema = 3.4.0
-zope.security = 3.4.1
-zope.securitypolicy = 3.4.1
-zope.server = 3.4.3
-zope.session = 3.4.1
-zope.size = 3.4.0
-zope.structuredtext = 3.4.0
-zope.tal = 3.4.1
-zope.tales = 3.4.0
-zope.testbrowser = 3.4.2
-zope.testing = 3.7.6
-zope.thread = 3.4
-zope.traversing = 3.4.1
-zope.viewlet = 3.4.2
More information about the checkins
mailing list