[Checkins] SVN: five.megrok.z3cpt/ Base support for z3c.pt in Zope 2 with Grok.
Sylvain Viollon
sylvain at infrae.com
Mon Oct 6 09:23:57 EDT 2008
Log message for revision 91809:
Base support for z3c.pt in Zope 2 with Grok.
Changed:
A five.megrok.z3cpt/
A five.megrok.z3cpt/trunk/
A five.megrok.z3cpt/trunk/README.txt
A five.megrok.z3cpt/trunk/docs/
A five.megrok.z3cpt/trunk/docs/HISTORY.txt
A five.megrok.z3cpt/trunk/five/
A five.megrok.z3cpt/trunk/five/__init__.py
A five.megrok.z3cpt/trunk/five/megrok/
A five.megrok.z3cpt/trunk/five/megrok/__init__.py
A five.megrok.z3cpt/trunk/five/megrok/z3cpt/
A five.megrok.z3cpt/trunk/five/megrok/z3cpt/__init__.py
A five.megrok.z3cpt/trunk/five/megrok/z3cpt/configure.zcml
A five.megrok.z3cpt/trunk/five/megrok/z3cpt/templatereg.py
A five.megrok.z3cpt/trunk/setup.cfg
A five.megrok.z3cpt/trunk/setup.py
-=-
Added: five.megrok.z3cpt/trunk/README.txt
===================================================================
--- five.megrok.z3cpt/trunk/README.txt (rev 0)
+++ five.megrok.z3cpt/trunk/README.txt 2008-10-06 13:23:57 UTC (rev 91809)
@@ -0,0 +1,4 @@
+Introduction
+============
+
+
Added: five.megrok.z3cpt/trunk/docs/HISTORY.txt
===================================================================
--- five.megrok.z3cpt/trunk/docs/HISTORY.txt (rev 0)
+++ five.megrok.z3cpt/trunk/docs/HISTORY.txt 2008-10-06 13:23:57 UTC (rev 91809)
@@ -0,0 +1,8 @@
+Changelog
+=========
+
+1.0 - Unreleased
+----------------
+
+* Initial release
+
Added: five.megrok.z3cpt/trunk/five/__init__.py
===================================================================
--- five.megrok.z3cpt/trunk/five/__init__.py (rev 0)
+++ five.megrok.z3cpt/trunk/five/__init__.py 2008-10-06 13:23:57 UTC (rev 91809)
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
Added: five.megrok.z3cpt/trunk/five/megrok/__init__.py
===================================================================
--- five.megrok.z3cpt/trunk/five/megrok/__init__.py (rev 0)
+++ five.megrok.z3cpt/trunk/five/megrok/__init__.py 2008-10-06 13:23:57 UTC (rev 91809)
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
Added: five.megrok.z3cpt/trunk/five/megrok/z3cpt/__init__.py
===================================================================
Added: five.megrok.z3cpt/trunk/five/megrok/z3cpt/configure.zcml
===================================================================
--- five.megrok.z3cpt/trunk/five/megrok/z3cpt/configure.zcml (rev 0)
+++ five.megrok.z3cpt/trunk/five/megrok/z3cpt/configure.zcml 2008-10-06 13:23:57 UTC (rev 91809)
@@ -0,0 +1,12 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:grok="http://namespaces.zope.org/grok">
+
+ <include package="five.pt" />
+
+ <include package="five.grok" file="meta.zcml" />
+ <include package="five.grok" />
+
+ <grok:grok package=".templatereg" />
+
+</configure>
Added: five.megrok.z3cpt/trunk/five/megrok/z3cpt/templatereg.py
===================================================================
--- five.megrok.z3cpt/trunk/five/megrok/z3cpt/templatereg.py (rev 0)
+++ five.megrok.z3cpt/trunk/five/megrok/z3cpt/templatereg.py 2008-10-06 13:23:57 UTC (rev 91809)
@@ -0,0 +1,28 @@
+
+from grokcore.view.components import PageTemplate
+from grokcore.view.interfaces import ITemplateFileFactory
+
+from five import grok
+from five.pt.pagetemplate import ViewPageTemplateFile
+
+class ZopeTwoPageTemplate(PageTemplate):
+
+ def setFromString(self, string):
+ raise NotImplementedError
+
+ def setFromFilename(self, filename, _prefix=None):
+ self._template = ViewPageTemplateFile(filename, _prefix)
+
+ def _initFactory(self, factory):
+ pass
+
+ def render(self, view):
+ return self._template(view)()
+
+
+class ZopeTwoPageTemplateFileFactory(grok.GlobalUtility):
+ grok.implements(ITemplateFileFactory)
+ grok.name('zpt')
+
+ def __call__(self, filename, _prefix=None):
+ return ZopeTwoPageTemplate(filename=filename, _prefix=_prefix)
Added: five.megrok.z3cpt/trunk/setup.cfg
===================================================================
--- five.megrok.z3cpt/trunk/setup.cfg (rev 0)
+++ five.megrok.z3cpt/trunk/setup.cfg 2008-10-06 13:23:57 UTC (rev 91809)
@@ -0,0 +1,3 @@
+[egg_info]
+tag_build = dev
+tag_svn_revision = true
Added: five.megrok.z3cpt/trunk/setup.py
===================================================================
--- five.megrok.z3cpt/trunk/setup.py (rev 0)
+++ five.megrok.z3cpt/trunk/setup.py 2008-10-06 13:23:57 UTC (rev 91809)
@@ -0,0 +1,30 @@
+from setuptools import setup, find_packages
+import os
+
+version = '1.0'
+
+setup(name='five.megrok.z3cpt',
+ version=version,
+ description="Grok support for z3c.pt in Zope 2",
+ long_description=open("README.txt").read() + "\n" +
+ open(os.path.join("docs", "HISTORY.txt")).read(),
+ # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+ classifiers=[
+ "Programming Language :: Python",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ ],
+ keywords='zope2 z3c pt grok',
+ author='Sylvain Viollon',
+ author_email='sylvain at infrae.com',
+ url='',
+ license='GPL',
+ packages=find_packages(exclude=['ez_setup']),
+ namespace_packages=['five', 'five.megrok'],
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=[
+ 'setuptools',
+ 'five.pt',
+ 'five.grok',
+ ],
+ )
More information about the Checkins
mailing list