[Checkins] SVN: Sandbox/cklinger/megrok.pagelet/trunk/ Fix project information, README format, changelog.
Sylvain Viollon
sylvain at infrae.com
Fri Apr 10 09:25:10 EDT 2009
Log message for revision 99076:
Fix project information, README format, changelog.
Changed:
U Sandbox/cklinger/megrok.pagelet/trunk/CHANGES.txt
U Sandbox/cklinger/megrok.pagelet/trunk/README.txt
U Sandbox/cklinger/megrok.pagelet/trunk/setup.py
-=-
Modified: Sandbox/cklinger/megrok.pagelet/trunk/CHANGES.txt
===================================================================
--- Sandbox/cklinger/megrok.pagelet/trunk/CHANGES.txt 2009-04-10 12:49:15 UTC (rev 99075)
+++ Sandbox/cklinger/megrok.pagelet/trunk/CHANGES.txt 2009-04-10 13:25:10 UTC (rev 99076)
@@ -1,10 +1,13 @@
-trunk (2009-03-24)
-==================
+Changelog
+=========
- - xxx [Ingeniweb]
+0.2 (unreleased)
+----------------
+- ...
+
0.1 (2009-03-24)
-------------------
+----------------
-Initial release as egg.
+- Initial release as egg.
Modified: Sandbox/cklinger/megrok.pagelet/trunk/README.txt
===================================================================
--- Sandbox/cklinger/megrok.pagelet/trunk/README.txt 2009-04-10 12:49:15 UTC (rev 99075)
+++ Sandbox/cklinger/megrok.pagelet/trunk/README.txt 2009-04-10 13:25:10 UTC (rev 99076)
@@ -1,66 +1,63 @@
MEGROK PAGELET
==============
-This package try to bring the functionality of z3c.template and
-z3c.pagelet to grok.
-
-z3c.template gives us a alternative for the zpt:metal layout based system in grok.
-The z3c.pagelet has the advantage that it´s possible to register layouts with help of
-the zope-component-architecuture this allows us to change or modify layouts
-without touching the *master* macro.
+This package try to bring the functionality of `z3c.template`_ and
+`z3c.pagelet`_ to Grok.
-This means you have megrok.pagelet.Layout component which holds
-the layout. Instead of using grok.View you have to take
-megrok.pagelet.Pagelet for normal BrowserViews.
+`z3c.template`_ gives an alternative way to the ``zpt:metal`` layout
+based system in Grok. `z3c.pagelet`_ provides the possibility to
+register layouts with the help of the zope component
+architecture. This allows to separate the rendering of the layout and
+the content.
-If you need more information about z3c.template please look here [1].
+This is implemented with the help of the ``megrok.pagelet.Layout``
+component which holds the layout.
-The Layout
-----------
+The Layout (Skin)
+-----------------
-The first thing we have to do is set up a layout for our pagelet.
+The first thing we have to do is to define a layout::
-class MyLayout(megrok.pagelet.Layout):
- grok.context()
- grok.layer()
+ class MyLayout(megrok.pagelet.Layout):
+ grok.context()
+ grok.layer()
- megrok.pagelet.template('my_layout_template.pt')
+ megrok.pagelet.template('my_layout_template.pt')
-This configures the template ('my_layout_template.pt') as a layout for the given
-context and layer. Of course it´s possible to specify different
-layouts for different layers or contexts.
+The template ``my_layout_template.pt`` is registered as a layout for
+the given context and layer. Of course it's possible to specify
+different layouts for different layers or contexts.
+In the content of ``my_layout_template.pt`` is something like this::
-In the content of my_layout_template.pt is something like this:
+ <html>
+ <body>
+ <div class="layout" tal:content="structure view/render">
+ here comes the content
+ </div>
+ </body>
+ </html>
-<html>
- <body>
- <div class="layout" tal:content="structure view/render">
- here comes the content
- </div>
- </body>
-</html>
+The Pagelet (View)
+------------------
-The Pagelt (View)
------------------
+Instead of using the common ``grok.View`` for our views we use now
+``megrok.pagelet.Paglet``. This component has one difference to a
+normal view, it does not only return the rendered content of the
+component, it first search for the layout in given context and layer
+and then it renders the content in this layout::
-Ok instead of using the common grok.View for our BrowserViews we use now
-megrok.pagelet.Paglet. This component has one difference to a normal
-grok.View. This difference is in the __call__ method of the megrok.pagelet.Pagelet.
-This means that the __call__ method of a Pagelet does not only return the renderd
-"template" of the Pagelet. The __call__ first search for the layout in given context
-and layer and then it renders the "template" in this layout.
+ class View(megrok.pagelet.Pagelet)
+ grok.context()
+ grok.layer()
+ grok.name()
-class View(megrok.pagelet.Pagelet)
- grok.context()
- grok.layer()
- grok.name()
+ def render(self)
+ return u"Something"
- def render(self)
- return "..."
+Now if you point your browser on ``.../view`` you sould see the
+rendered view in the given layout.
-Now if you point your browser on .../view you sould see the renderd view in the
-given layout.
-
-[1] http://pypi.python.org/pypi/z3c.template/1.1.0
+.. _z3c.template: http://pypi.python.org/pypi/z3c.template
+.. _z3c.pagelet: http://pypi.python.org/pypi/z3c.pagelet
Modified: Sandbox/cklinger/megrok.pagelet/trunk/setup.py
===================================================================
--- Sandbox/cklinger/megrok.pagelet/trunk/setup.py 2009-04-10 12:49:15 UTC (rev 99075)
+++ Sandbox/cklinger/megrok.pagelet/trunk/setup.py 2009-04-10 13:25:10 UTC (rev 99076)
@@ -5,18 +5,19 @@
open("CHANGES.txt").read())
setup(name='megrok.pagelet',
- version='0.1',
+ version='0.2dev',
description="z3c.template / z3c.layout support for Grok",
long_description=long_description,
# Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
- classifiers=['Programming Language :: Python',
- 'Environment :: Web Environment',
- 'Framework :: Zope3',
- 'License :: OSI Approved :: Zope Public License',
- ],
- keywords='',
- author='',
- author_email='',
+ classifiers=[
+ 'Programming Language :: Python',
+ 'Environment :: Web Environment',
+ 'Framework :: Zope3',
+ 'License :: OSI Approved :: Zope Public License',
+ ],
+ keywords='grok pagelet layout',
+ author='Grok Team',
+ author_email='grok-dev at zope.org',
url='http://pypi.python.org/pypi/megrok.pagelet',
license='ZPL',
packages=find_packages('src'),
@@ -29,9 +30,6 @@
'martian',
'grokcore.component',
'z3c.template',
- 'grok', # just for the ViewGrokker
+ 'grok',
],
- entry_points="""
- # -*- Entry points: -*-
- """,
)
More information about the Checkins
mailing list