[Checkins] SVN: z3c.recipe.paster/ Added initial implementation
Roger Ineichen
roger at projekt01.ch
Sat Jun 28 09:32:21 EDT 2008
Log message for revision 87839:
Added initial implementation
See README.txt for more infos or ask ;-)
Changed:
A z3c.recipe.paster/branches/
A z3c.recipe.paster/tags/
A z3c.recipe.paster/trunk/
A z3c.recipe.paster/trunk/CHANGES.txt
A z3c.recipe.paster/trunk/README.txt
A z3c.recipe.paster/trunk/bootstrap.py
A z3c.recipe.paster/trunk/buildout.cfg
A z3c.recipe.paster/trunk/setup.py
A z3c.recipe.paster/trunk/src/
A z3c.recipe.paster/trunk/src/z3c/
A z3c.recipe.paster/trunk/src/z3c/__init__.py
A z3c.recipe.paster/trunk/src/z3c/recipe/
A z3c.recipe.paster/trunk/src/z3c/recipe/__init__.py
A z3c.recipe.paster/trunk/src/z3c/recipe/paster/
A z3c.recipe.paster/trunk/src/z3c/recipe/paster/README.txt
A z3c.recipe.paster/trunk/src/z3c/recipe/paster/__init__.py
A z3c.recipe.paster/trunk/src/z3c/recipe/paster/serve.py
A z3c.recipe.paster/trunk/src/z3c/recipe/paster/tests.py
A z3c.recipe.paster/trunk/src/z3c/recipe/paster/wsgi.py
-=-
Added: z3c.recipe.paster/trunk/CHANGES.txt
===================================================================
--- z3c.recipe.paster/trunk/CHANGES.txt (rev 0)
+++ z3c.recipe.paster/trunk/CHANGES.txt 2008-06-28 13:32:19 UTC (rev 87839)
@@ -0,0 +1,8 @@
+=======
+CHANGES
+=======
+
+Version 0.5.0dev (unreleased)
+-----------------------------
+
+- Initial Release
Property changes on: z3c.recipe.paster/trunk/CHANGES.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: z3c.recipe.paster/trunk/README.txt
===================================================================
--- z3c.recipe.paster/trunk/README.txt (rev 0)
+++ z3c.recipe.paster/trunk/README.txt 2008-06-28 13:32:19 UTC (rev 87839)
@@ -0,0 +1,6 @@
+The ``z3c.recipe.paster:serve`` generates a paste deploy serve scripts and
+configuration files for starting a paste deploy based Zope 3 setup. The
+paste deploy *.ini file content can get defined in the buildout.cfg file.
+
+Note, you have to define an entry_point in your projects setup.py file for
+using a application_factory via the section name.
Property changes on: z3c.recipe.paster/trunk/README.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: z3c.recipe.paster/trunk/bootstrap.py
===================================================================
--- z3c.recipe.paster/trunk/bootstrap.py (rev 0)
+++ z3c.recipe.paster/trunk/bootstrap.py 2008-06-28 13:32:19 UTC (rev 87839)
@@ -0,0 +1,56 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 77225 2007-06-29 09:20:13Z dobe $
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+ import pkg_resources
+except ImportError:
+ ez = {}
+ exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+ ).read() in ez
+ ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+ import pkg_resources
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+if sys.platform == 'win32':
+ cmd = '"%s"' % cmd # work around spawn lamosity on windows
+
+ws = pkg_resources.working_set
+assert os.spawnle(
+ os.P_WAIT, sys.executable, sys.executable,
+ '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)
+
Property changes on: z3c.recipe.paster/trunk/bootstrap.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: z3c.recipe.paster/trunk/buildout.cfg
===================================================================
--- z3c.recipe.paster/trunk/buildout.cfg (rev 0)
+++ z3c.recipe.paster/trunk/buildout.cfg 2008-06-28 13:32:19 UTC (rev 87839)
@@ -0,0 +1,7 @@
+[buildout]
+parts = test
+develop = .
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = z3c.recipe.paster [test]
Added: z3c.recipe.paster/trunk/setup.py
===================================================================
--- z3c.recipe.paster/trunk/setup.py (rev 0)
+++ z3c.recipe.paster/trunk/setup.py 2008-06-28 13:32:19 UTC (rev 87839)
@@ -0,0 +1,82 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Setup
+
+$Id: setup.py 82497 2007-12-28 14:59:22Z rogerineichen $
+"""
+import os
+import xml.sax.saxutils
+from setuptools import setup, find_packages
+
+
+def read(*rnames):
+ text = open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+ return xml.sax.saxutils.escape(text)
+
+setup(
+ name = 'z3c.recipe.paster',
+ version = '0.5.0dev',
+ author = 'Roger Ineichen and the Zope Community',
+ author_email = 'zope-dev at zope.org',
+ description = 'Zope3 paste deploy setup recipe',
+ long_description=(
+ read('README.txt')
+ + '\n\n' +
+ read('CHANGES.txt')
+ ),
+ license = 'ZPL 2.1',
+ keywords = 'zope zope3 z3c paste deploy recipe',
+ classifiers = [
+ 'Development Status :: 4 - Beta',
+ 'Environment :: Web Environment',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: Zope Public License',
+ 'Programming Language :: Python',
+ 'Natural Language :: English',
+ 'Operating System :: Microsoft :: Windows',
+ 'Topic :: Internet :: WWW/HTTP',
+ 'Framework :: Zope3'],
+ url = 'http://pypi.python.org/pypi/z3c.recipe.paster',
+ packages = find_packages('src'),
+ include_package_data = True,
+ package_dir = {'':'src'},
+ namespace_packages = ['z3c', 'z3c.recipe'],
+ extras_require = dict(
+ test = [
+ 'zope.testing',
+ 'zc.recipe.egg',
+ 'ZConfig >=2.4a5',
+ 'zc.recipe.filestorage',
+ 'zope.app.appsetup',
+ ],
+ ),
+ install_requires = [
+ 'Paste',
+ 'PasteDeploy',
+ 'PasteScript',
+ 'ZConfig >=2.4a5',
+ 'setuptools',
+ 'zc.buildout',
+ 'zc.recipe.egg',
+ 'zope.app.wsgi',
+ 'zope.security',
+ 'zope.schema',
+ 'zope.interface',
+ ],
+ entry_points = {
+ 'zc.buildout': [
+ 'serve = z3c.recipe.paster.serve:ServeSetup',
+ ]
+ },
+)
Property changes on: z3c.recipe.paster/trunk/setup.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: z3c.recipe.paster/trunk/src/z3c/__init__.py
===================================================================
--- z3c.recipe.paster/trunk/src/z3c/__init__.py (rev 0)
+++ z3c.recipe.paster/trunk/src/z3c/__init__.py 2008-06-28 13:32:19 UTC (rev 87839)
@@ -0,0 +1,6 @@
+# namespace package boilerplate
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError, e:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
Property changes on: z3c.recipe.paster/trunk/src/z3c/__init__.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: z3c.recipe.paster/trunk/src/z3c/recipe/__init__.py
===================================================================
--- z3c.recipe.paster/trunk/src/z3c/recipe/__init__.py (rev 0)
+++ z3c.recipe.paster/trunk/src/z3c/recipe/__init__.py 2008-06-28 13:32:19 UTC (rev 87839)
@@ -0,0 +1,6 @@
+# namespace package boilerplate
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError, e:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
Property changes on: z3c.recipe.paster/trunk/src/z3c/recipe/__init__.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: z3c.recipe.paster/trunk/src/z3c/recipe/paster/README.txt
===================================================================
--- z3c.recipe.paster/trunk/src/z3c/recipe/paster/README.txt (rev 0)
+++ z3c.recipe.paster/trunk/src/z3c/recipe/paster/README.txt 2008-06-28 13:32:19 UTC (rev 87839)
@@ -0,0 +1,176 @@
+======
+README
+======
+
+z3c.recipe.paster
+-----------------
+
+This Zope 3 recipes offers a Paste Deploy setup for Zope3 projects.
+
+
+Options
+*******
+
+The 'serve' recipe accepts the following options:
+
+eggs
+ The names of one or more eggs, with their dependencies that should
+ be included in the Python path of the generated scripts.
+
+ini
+ The paste deploy *.ini file content.
+
+zope.conf
+ The zope.conf file defining the DB used in the WSGI app and the error log
+ section.
+
+site.zcml
+ The zope site.zcml file used by the zope application.
+
+
+Test
+****
+
+Lets define a (bogus) eggs that we can use in our application:
+
+ >>> mkdir('demo')
+ >>> write('demo', 'setup.py',
+ ... '''
+ ... from setuptools import setup
+ ... setup(name = 'demo')
+ ... ''')
+
+Now check if the setup was correct:
+
+ >>> ls('bin')
+ - buildout-script.py
+ - buildout.exe
+
+We'll create a ``buildout.cfg`` file that defines our paster serve configuration:
+
+ >>> write('buildout.cfg',
+ ... '''
+ ... [buildout]
+ ... develop = demo
+ ... parts = var myapp
+ ...
+ ... [var]
+ ... recipe = zc.recipe.filestorage
+ ...
+ ... [myapp]
+ ... eggs = demo
+ ... recipe = z3c.recipe.paster:serve
+ ... ini =
+ ... [app:main]
+ ... use = egg:demo
+ ...
+ ... [server:main]
+ ... use = egg:Paste#http
+ ... host = 127.0.0.1
+ ... port = 8080
+ ...
+ ... zope.conf =
+ ...
+ ... ${var:zconfig}
+ ...
+ ... <eventlog>
+ ... <logfile>
+ ... formatter zope.exceptions.log.Formatter
+ ... path ${buildout:directory}/parts/myapp/error.log
+ ... </logfile>
+ ... <logfile>
+ ... formatter zope.exceptions.log.Formatter
+ ... path STDOUT
+ ... </logfile>
+ ... </eventlog>
+ ...
+ ... devmode on
+ ...
+ ... site.zcml =
+ ... <!-- inlcude other zcml files like principals.zcml or securitypolicy.zcml
+ ... and your app configuration -->
+ ... <include package="demo" file="app.zcml" />
+ ...
+ ... ''' % globals())
+
+Now, Let's run the buildout and see what we get:
+
+ >>> print system(join('bin', 'buildout')),
+ Develop: '/sample-buildout/demo'
+ Installing var.
+ Installing myapp.
+ Generated script '/sample-buildout/bin/myapp'.
+
+The bin folder contains the scripts for serve our new created paste deploy
+server:
+
+ >>> ls('bin')
+ - buildout-script.py
+ - buildout.exe
+ - myapp-script.py
+ - myapp.exe
+
+Check the content of our new generated myapp script. As you can see, the
+generated script uses the ``paste.script.command.run`` for starting our server:
+
+ >>> cat('bin', 'myapp-script.py')
+ #!"C:\Python24\python.exe"
+ <BLANKLINE>
+ import sys
+ sys.path[0:0] = [
+ '...demo',
+ ]
+ <BLANKLINE>
+ import os
+ sys.argv[0] = os.path.abspath(sys.argv[0])
+ <BLANKLINE>
+ <BLANKLINE>
+ import paste.script.command
+ <BLANKLINE>
+ if __name__ == '__main__':
+ paste.script.command.run([
+ 'serve', '...myapp.ini',
+ ]+sys.argv[1:])
+
+Check the content of our new generated myapp.ini file:
+
+ >>> cat('parts', 'myapp', 'myapp.ini')
+ <BLANKLINE>
+ [app:main]
+ use = egg:demo
+ [server:main]
+ use = egg:Paste#http
+ host = 127.0.0.1
+ port = 8080
+
+
+Entry point
+-----------
+
+As you probably know, there is some magic going on during startup. The section
+``app:main`` in the myapp.ini file above must be defined as entry_point in your
+projects setup.py file. Without them, the ``app:main`` isn't available. You can
+define such a app:main entry point using the default ``application_factory``
+offered from the ``z3c.recipe.paster.wsgi`` package. Of corse you can define
+your own application factory if you need to pass some additional configuration
+for your app to the factroy defined in your custom *.ini file.
+
+The default entry_point offered from the z3c.recipe.paster could be included in
+your custom setup.py file like:
+
+ setup(
+ name = 'something',
+ version = '0.5.0dev',
+ ...
+ include_package_data = True,
+ package_dir = {'':'src'},
+ namespace_packages = [],
+ install_requires = [
+ 'some.package',
+ ],
+ entry_points = """
+ [paste.app_factory]
+ main = z3c.recipe.paster.wsgi:application_factory
+ """,
+ )
+
Property changes on: z3c.recipe.paster/trunk/src/z3c/recipe/paster/README.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: z3c.recipe.paster/trunk/src/z3c/recipe/paster/__init__.py
===================================================================
--- z3c.recipe.paster/trunk/src/z3c/recipe/paster/__init__.py (rev 0)
+++ z3c.recipe.paster/trunk/src/z3c/recipe/paster/__init__.py 2008-06-28 13:32:19 UTC (rev 87839)
@@ -0,0 +1 @@
+# make a package
Property changes on: z3c.recipe.paster/trunk/src/z3c/recipe/paster/__init__.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: z3c.recipe.paster/trunk/src/z3c/recipe/paster/serve.py
===================================================================
--- z3c.recipe.paster/trunk/src/z3c/recipe/paster/serve.py (rev 0)
+++ z3c.recipe.paster/trunk/src/z3c/recipe/paster/serve.py 2008-06-28 13:32:19 UTC (rev 87839)
@@ -0,0 +1,152 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Paste deploy recipes for Zope3 apps
+
+$Id:$
+"""
+
+import os
+import sys
+import shutil
+import cStringIO
+import ZConfig.schemaless
+import zc.buildout
+import zc.recipe.egg
+
+
+class ServeSetup:
+ """Paste serve setup script."""
+
+ def __init__(self, buildout, name, options):
+ self.egg = None
+ self.buildout = buildout
+ self.name = name
+ self.options = options
+ options['script'] = os.path.join(buildout['buildout']['bin-directory'],
+ options.get('script', self.name),
+ )
+ if not options.get('working-directory', ''):
+ options['location'] = os.path.join(
+ buildout['buildout']['parts-directory'], name)
+
+ if options.get('eggs'):
+ self.egg = zc.recipe.egg.Egg(buildout, name, options)
+
+ def install(self):
+ options = self.options
+ location = options['location']
+ executable = self.buildout['buildout']['executable']
+
+ # setup path
+ dest = []
+ if not os.path.exists(location):
+ os.mkdir(location)
+ dest.append(location)
+
+ event_log_path = os.path.join(location, 'error.log')
+ site_zcml_path = os.path.join(location, 'site.zcml')
+
+ # append file to dest which will remove it on update
+ dest.append(site_zcml_path)
+
+
+ # setup site.zcml
+ open(site_zcml_path, 'w').write(
+ site_zcml_template % self.options['site.zcml']
+ )
+
+ # setup *.ini file
+ ini_conf = options.get('ini', '')+'\n'
+ ini_path = os.path.join(location, '%s.ini' % self.name)
+ open(ini_path, 'w').write(str(ini_conf))
+
+ # append file to dest which will remove it on update
+ dest.append(ini_path)
+
+ # setup zope.conf
+ zope_conf = options.get('zope.conf', '')+'\n'
+ zope_conf = ZConfig.schemaless.loadConfigFile(
+ cStringIO.StringIO(zope_conf))
+
+ zope_conf['site-definition'] = [site_zcml_path]
+
+ if not [s for s in zope_conf.sections if s.type == 'zodb']:
+ raise zc.buildout.UserError(
+ 'No database sections have been defined.')
+
+ if not [s for s in zope_conf.sections if s.type == 'eventlog']:
+ zope_conf.sections.append(event_log(event_log_path))
+
+ zope_conf_path = os.path.join(location, 'zope.conf')
+ open(zope_conf_path, 'w').write(str(zope_conf))
+
+ # append file to dest which will remove it on update
+ dest.append(zope_conf_path)
+
+ # setup paster script
+ if self.egg is not None:
+ extra_paths = self.egg.extra_paths
+ else:
+ extra_paths = []
+
+ eggs, ws = self.egg.working_set()
+
+ defaults = options.get('defaults', '').strip()
+ if defaults:
+ defaults = '(%s) + ' % defaults
+
+ initialization = initialization_template
+ dest.extend(zc.buildout.easy_install.scripts(
+ [('%s'% self.name, 'paste.script.command', 'run')],
+ ws, self.options['executable'],
+ self.buildout['buildout']['bin-directory'],
+ extra_paths = extra_paths,
+ arguments = defaults + (arg_template % dict(
+ INI_PATH=ini_path,
+ )),
+ initialization = initialization_template
+ ))
+
+ return dest
+
+ update = install
+
+
+# setup helper
+arg_template = """[
+ 'serve', %(INI_PATH)r,
+ ]+sys.argv[1:]"""
+
+
+site_zcml_template = """\
+<configure
+ xmlns="http://namespaces.zope.org/zope">
+%s
+
+</configure>
+"""
+
+
+initialization_template = """import os
+sys.argv[0] = os.path.abspath(sys.argv[0])
+"""
+
+def event_log(path, *data):
+ return ZConfig.schemaless.Section(
+ 'eventlog', '', None,
+ [ZConfig.schemaless.Section(
+ 'logfile',
+ '',
+ dict(path=[path])),
+ ])
Property changes on: z3c.recipe.paster/trunk/src/z3c/recipe/paster/serve.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: z3c.recipe.paster/trunk/src/z3c/recipe/paster/tests.py
===================================================================
--- z3c.recipe.paster/trunk/src/z3c/recipe/paster/tests.py (rev 0)
+++ z3c.recipe.paster/trunk/src/z3c/recipe/paster/tests.py 2008-06-28 13:32:19 UTC (rev 87839)
@@ -0,0 +1,137 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Tests
+
+$Id:$
+"""
+
+import re
+import unittest
+from zope.testing import doctest
+from zope.testing import renormalizing
+
+import zc.buildout.testing
+
+
+def setUp(test):
+ zc.buildout.testing.buildoutSetUp(test)
+ zc.buildout.testing.install_develop('z3c.recipe.paster', test)
+ zc.buildout.testing.install('RestrictedPython', test)
+ zc.buildout.testing.install('ZConfig', test)
+ zc.buildout.testing.install('ZODB3', test)
+ zc.buildout.testing.install('pytz', test)
+ zc.buildout.testing.install('zc.recipe.egg', test)
+ zc.buildout.testing.install('zc.recipe.filestorage', test)
+ zc.buildout.testing.install('zdaemon', test)
+ zc.buildout.testing.install('zodbcode', test)
+ zc.buildout.testing.install('zope.annotation', test)
+ zc.buildout.testing.install('zope.app.applicationcontrol', test)
+ zc.buildout.testing.install('zope.app.appsetup', test)
+ zc.buildout.testing.install('zope.app.authentication', test)
+ zc.buildout.testing.install('zope.app.basicskin', test)
+ zc.buildout.testing.install('zope.app.broken', test)
+ zc.buildout.testing.install('zope.app.component', test)
+ zc.buildout.testing.install('zope.app.container', test)
+ zc.buildout.testing.install('zope.app.content', test)
+ zc.buildout.testing.install('zope.app.debug', test)
+ zc.buildout.testing.install('zope.app.dependable', test)
+ zc.buildout.testing.install('zope.app.error', test)
+ zc.buildout.testing.install('zope.app.exception', test)
+ zc.buildout.testing.install('zope.app.folder', test)
+ zc.buildout.testing.install('zope.app.form', test)
+ zc.buildout.testing.install('zope.app.generations', test)
+ zc.buildout.testing.install('zope.app.http', test)
+ zc.buildout.testing.install('zope.app.i18n', test)
+ zc.buildout.testing.install('zope.app.interface', test)
+ zc.buildout.testing.install('zope.app.locales', test)
+ zc.buildout.testing.install('zope.app.pagetemplate', test)
+ zc.buildout.testing.install('zope.app.principalannotation', test)
+ zc.buildout.testing.install('zope.app.publication', test)
+ zc.buildout.testing.install('zope.app.publisher', test)
+ zc.buildout.testing.install('zope.app.renderer', test)
+ zc.buildout.testing.install('zope.app.rotterdam', test)
+ zc.buildout.testing.install('zope.app.schema', test)
+ zc.buildout.testing.install('zope.app.security', test)
+ zc.buildout.testing.install('zope.app.session', test)
+ zc.buildout.testing.install('zope.app.testing', test)
+ zc.buildout.testing.install('zope.app.wsgi', test)
+ zc.buildout.testing.install('zope.app.zapi', test)
+ zc.buildout.testing.install('zope.app.zcmlfiles', test)
+ zc.buildout.testing.install('zope.app.zopeappgenerations', test)
+ zc.buildout.testing.install('zope.cachedescriptors', test)
+ zc.buildout.testing.install('zope.component', test)
+ zc.buildout.testing.install('zope.configuration', test)
+ zc.buildout.testing.install('zope.contenttype', test)
+ zc.buildout.testing.install('zope.copypastemove', test)
+ zc.buildout.testing.install('zope.datetime', test)
+ zc.buildout.testing.install('zope.deferredimport', test)
+ zc.buildout.testing.install('zope.deprecation', test)
+ zc.buildout.testing.install('zope.dottedname', test)
+ zc.buildout.testing.install('zope.dublincore', test)
+ zc.buildout.testing.install('zope.error', test)
+ zc.buildout.testing.install('zope.event', test)
+ zc.buildout.testing.install('zope.exceptions', test)
+ zc.buildout.testing.install('zope.filerepresentation', test)
+ zc.buildout.testing.install('zope.formlib', test)
+ zc.buildout.testing.install('zope.hookable', test)
+ zc.buildout.testing.install('zope.i18n', test)
+ zc.buildout.testing.install('zope.i18nmessageid', test)
+ zc.buildout.testing.install('zope.interface', test)
+ zc.buildout.testing.install('zope.lifecycleevent', test)
+ zc.buildout.testing.install('zope.location', test)
+ zc.buildout.testing.install('zope.minmax', test)
+ zc.buildout.testing.install('zope.modulealias', test)
+ zc.buildout.testing.install('zope.pagetemplate', test)
+ zc.buildout.testing.install('zope.proxy', test)
+ zc.buildout.testing.install('zope.publisher', test)
+ zc.buildout.testing.install('zope.schema', test)
+ zc.buildout.testing.install('zope.security', test)
+ zc.buildout.testing.install('zope.session', test)
+ zc.buildout.testing.install('zope.size', test)
+ zc.buildout.testing.install('zope.structuredtext', test)
+ zc.buildout.testing.install('zope.tal', test)
+ zc.buildout.testing.install('zope.tales', test)
+ zc.buildout.testing.install('zope.testing', test)
+ zc.buildout.testing.install('zope.thread', test)
+ zc.buildout.testing.install('zope.traversing', test)
+ # The BIG dependency mess in zope is really a pain
+
+
+checker = renormalizing.RENormalizing([
+ zc.buildout.testing.normalize_path,
+ (re.compile(
+ "Couldn't find index page for '[a-zA-Z0-9.]+' "
+ "\(maybe misspelled\?\)"
+ "\n"
+ ), ''),
+ (re.compile("""['"][^\n"']+z3c.recipe.paster[^\n"']*['"],"""),
+ "'/z3c.recipe.paster',"),
+ (re.compile('#![^\n]+\n'), ''),
+ (re.compile('-\S+-py\d[.]\d(-\S+)?.egg'),
+ '-pyN.N.egg',
+ ),
+ ])
+
+
+def test_suite():
+ return unittest.TestSuite(
+ doctest.DocFileSuite('README.txt',
+ setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown,
+ optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
+ checker=checker),
+ )
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
Property changes on: z3c.recipe.paster/trunk/src/z3c/recipe/paster/tests.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: z3c.recipe.paster/trunk/src/z3c/recipe/paster/wsgi.py
===================================================================
--- z3c.recipe.paster/trunk/src/z3c/recipe/paster/wsgi.py (rev 0)
+++ z3c.recipe.paster/trunk/src/z3c/recipe/paster/wsgi.py 2008-06-28 13:32:19 UTC (rev 87839)
@@ -0,0 +1,24 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Simple application_factory usable for define a buildout entry_point
+
+$Id:$
+"""
+
+import os
+import zope.app.wsgi
+
+def application_factory(global_conf, conf='zope.conf'):
+ zope_conf = os.path.join(global_conf['here'], conf)
+ return zope.app.wsgi.getWSGIApplication(zope_conf)
Property changes on: z3c.recipe.paster/trunk/src/z3c/recipe/paster/wsgi.py
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the Checkins
mailing list