[z3-checkins] r44863 - in z3/NudgeNudge/branches/zope-on-a-paste-demos: . tgdemo turbopaste turbopaste/ez_setup turbopaste/turbopaste turbopaste/turbopaste/config turbopaste/turbopaste/controllers turbopaste/turbopaste/docs turbopaste/turbopaste/i18n turbopaste/turbopaste/lib turbopaste/turbopaste/models turbopaste/turbopaste/public turbopaste/turbopaste/public/css turbopaste/turbopaste/public/images turbopaste/turbopaste/public/javascript turbopaste/turbopaste/templates turbopaste/turbopaste/tests turbopaste/turbopaste/tests/functional
philikon at codespeak.net
philikon at codespeak.net
Mon Jul 9 11:01:57 CEST 2007
Author: philikon
Date: Mon Jul 9 11:01:55 2007
New Revision: 44863
Added:
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/README.txt (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/development.ini
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/README.txt (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/__init__.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/setup.cfg
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/setup.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/test.ini
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/__init__.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/__init__.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/environment.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/middleware.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/routing.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/__init__.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/error.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/root.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/template.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/docs/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/docs/index.txt (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/i18n/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/i18n/__init__.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/__init__.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/app_globals.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/base.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/database.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/helpers.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/models/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/models/__init__.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/css/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/css/style.css (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/favicon.ico (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/header_inner.png (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/info.png (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/ok.png (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/tg_under_the_hood.png (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/under_the_hood_blue.png (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/javascript/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/__init__.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/index.html (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/master.html (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/__init__.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/functional/
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/functional/__init__.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/test_models.py (contents, props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/websetup.py (contents, props changed)
Removed:
z3/NudgeNudge/branches/zope-on-a-paste-demos/tgdemo/
Modified:
z3/NudgeNudge/branches/zope-on-a-paste-demos/ (props changed)
z3/NudgeNudge/branches/zope-on-a-paste-demos/buildout.cfg
z3/NudgeNudge/branches/zope-on-a-paste-demos/combined.ini
Log:
Switch to TurboGears2 (which runs on Pylons).
Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/buildout.cfg
==============================================================================
--- z3/NudgeNudge/branches/zope-on-a-paste-demos/buildout.cfg (original)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/buildout.cfg Mon Jul 9 11:01:55 2007
@@ -1,6 +1,6 @@
[buildout]
parts = app data instance server test
-develop = . deliverance capitalizer turbogears tgdemo
+develop = . deliverance capitalizer TurboGears Pylons turbopaste
find-links = http://download.zope.org/distribution/
[zope3]
@@ -13,7 +13,9 @@
z3c.evalexception
capitalizer
Deliverance
- tgdemo
+ PasteScript
+ TurboGears2
+ turbopaste
[app]
database = data
Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/combined.ini
==============================================================================
--- z3/NudgeNudge/branches/zope-on-a-paste-demos/combined.ini (original)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/combined.ini Mon Jul 9 11:01:55 2007
@@ -1,10 +1,10 @@
[composite:main]
use = egg:Paste#urlmap
/zope = zope
-/tg = tgdemo
+/ = turbopaste
-[app:tgdemo]
-use = egg:tgdemo
+[app:turbopaste]
+use = egg:turbopaste
[app:zope]
use = egg:zope.paste
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/README.txt
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/README.txt Mon Jul 9 11:01:55 2007
@@ -0,0 +1,19 @@
+This file is for you to describe the turbopaste application. Typically
+you would include information such as the information below:
+
+Installation and Setup
+======================
+
+Install ``turbopaste`` using easy_install::
+
+ easy_install turbopaste
+
+Make a config file as follows::
+
+ paster make-config turbopaste config.ini
+
+Tweak the config file as appropriate and then setup the application::
+
+ paster setup-app config.ini
+
+Then you are ready to go.
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/development.ini
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/development.ini Mon Jul 9 11:01:55 2007
@@ -0,0 +1,41 @@
+#
+# turbopaste - Pylons development environment configuration
+#
+# The %(here)s variable will be replaced with the parent directory of this file
+#
+[DEFAULT]
+debug = true
+email_to = you at yourdomain.com
+smtp_server = localhost
+error_email_from = paste at localhost
+
+[server:main]
+use = egg:Paste#http
+host = 0.0.0.0
+port = 8080
+
+[app:main]
+use = egg:turbopaste
+cache_dir = %(here)s/data
+beaker.session.key = turbopaste
+beaker.session.secret = somesecret
+
+# If you'd like to fine-tune the individual locations of the cache data dirs
+# for the Cache data, or the Session saves, un-comment the desired
+# settings here:
+#beaker.cache.data_dir = %(here)s/data/cache
+#beaker.session.data_dir = %(here)s/data/sessions
+
+# Specify the database for SQLAlchemy to use via
+# pylons.database.session_context.
+# %(here) may include a ':' character on Windows environments; this can
+# invalidate the URI when specifying a SQLite db via path name
+#sqlalchemy.dburi = sqlite:///%(here)s/somedb.db
+
+# Specify the database for SQLObject to use via pylons.database.PackageHub.
+#sqlobject.dburi = sqlite://%(here)s/somedb.db
+
+# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*
+# Debug mode will enable the interactive debugging tool, allowing ANYONE to
+# execute malicious code after an exception is raised.
+#set debug = false
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/README.txt
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/README.txt Mon Jul 9 11:01:55 2007
@@ -0,0 +1,15 @@
+This directory exists so that Subversion-based projects can share a single
+copy of the ``ez_setup`` bootstrap module for ``setuptools``, and have it
+automatically updated in their projects when ``setuptools`` is updated.
+
+For your convenience, you may use the following svn:externals definition::
+
+ ez_setup svn://svn.eby-sarna.com/svnroot/ez_setup
+
+You can set this by executing this command in your project directory::
+
+ svn propedit svn:externals .
+
+And then adding the line shown above to the file that comes up for editing.
+Then, whenever you update your project, ``ez_setup`` will be updated as well.
+
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/__init__.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/__init__.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,231 @@
+#!python
+"""Bootstrap setuptools installation
+
+If you want to use setuptools in your package's setup.py, just include this
+file in the same directory with it, and add this to the top of your setup.py::
+
+ from ez_setup import use_setuptools
+ use_setuptools()
+
+If you want to require a specific version of setuptools, set a download
+mirror, or use an alternate download directory, you can do so by supplying
+the appropriate options to ``use_setuptools()``.
+
+This file can also be run as a script to install or upgrade setuptools.
+"""
+import sys
+DEFAULT_VERSION = "0.6c6"
+DEFAULT_URL = "http://cheeseshop.python.org/packages/%s/s/setuptools/" % sys.version[:3]
+
+md5_data = {
+ 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
+ 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
+ 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
+ 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
+ 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
+ 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
+ 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
+ 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
+ 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
+ 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
+ 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
+ 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
+ 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
+ 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
+ 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
+ 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
+ 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
+ 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
+ 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
+ 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
+ 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
+ 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20',
+ 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab',
+ 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53',
+}
+
+import sys, os
+
+def _validate_md5(egg_name, data):
+ if egg_name in md5_data:
+ from md5 import md5
+ digest = md5(data).hexdigest()
+ if digest != md5_data[egg_name]:
+ print >>sys.stderr, (
+ "md5 validation of %s failed! (Possible download problem?)"
+ % egg_name
+ )
+ sys.exit(2)
+ return data
+
+
+def use_setuptools(
+ version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
+ download_delay=15
+):
+ """Automatically find/download setuptools and make it available on sys.path
+
+ `version` should be a valid setuptools version number that is available
+ as an egg for download under the `download_base` URL (which should end with
+ a '/'). `to_dir` is the directory where setuptools will be downloaded, if
+ it is not already available. If `download_delay` is specified, it should
+ be the number of seconds that will be paused before initiating a download,
+ should one be required. If an older version of setuptools is installed,
+ this routine will print a message to ``sys.stderr`` and raise SystemExit in
+ an attempt to abort the calling script.
+ """
+ try:
+ import setuptools
+ if setuptools.__version__ == '0.0.1':
+ print >>sys.stderr, (
+ "You have an obsolete version of setuptools installed. Please\n"
+ "remove it from your system entirely before rerunning this script."
+ )
+ sys.exit(2)
+ except ImportError:
+ egg = download_setuptools(version, download_base, to_dir, download_delay)
+ sys.path.insert(0, egg)
+ import setuptools; setuptools.bootstrap_install_from = egg
+
+ import pkg_resources
+ try:
+ pkg_resources.require("setuptools>="+version)
+
+ except pkg_resources.VersionConflict, e:
+ # XXX could we install in a subprocess here?
+ print >>sys.stderr, (
+ "The required version of setuptools (>=%s) is not available, and\n"
+ "can't be installed while this script is running. Please install\n"
+ " a more recent version first.\n\n(Currently using %r)"
+ ) % (version, e.args[0])
+ sys.exit(2)
+
+def download_setuptools(
+ version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
+ delay = 15
+):
+ """Download setuptools from a specified location and return its filename
+
+ `version` should be a valid setuptools version number that is available
+ as an egg for download under the `download_base` URL (which should end
+ with a '/'). `to_dir` is the directory where the egg will be downloaded.
+ `delay` is the number of seconds to pause before an actual download attempt.
+ """
+ import urllib2, shutil
+ egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
+ url = download_base + egg_name
+ saveto = os.path.join(to_dir, egg_name)
+ src = dst = None
+ if not os.path.exists(saveto): # Avoid repeated downloads
+ try:
+ from distutils import log
+ if delay:
+ log.warn("""
+---------------------------------------------------------------------------
+This script requires setuptools version %s to run (even to display
+help). I will attempt to download it for you (from
+%s), but
+you may need to enable firewall access for this script first.
+I will start the download in %d seconds.
+
+(Note: if this machine does not have network access, please obtain the file
+
+ %s
+
+and place it in this directory before rerunning this script.)
+---------------------------------------------------------------------------""",
+ version, download_base, delay, url
+ ); from time import sleep; sleep(delay)
+ log.warn("Downloading %s", url)
+ src = urllib2.urlopen(url)
+ # Read/write all in one block, so we don't create a corrupt file
+ # if the download is interrupted.
+ data = _validate_md5(egg_name, src.read())
+ dst = open(saveto,"wb"); dst.write(data)
+ finally:
+ if src: src.close()
+ if dst: dst.close()
+ return os.path.realpath(saveto)
+
+def main(argv, version=DEFAULT_VERSION):
+ """Install or upgrade setuptools and EasyInstall"""
+
+ try:
+ import setuptools
+ except ImportError:
+ egg = None
+ try:
+ egg = download_setuptools(version, delay=0)
+ sys.path.insert(0,egg)
+ from setuptools.command.easy_install import main
+ return main(list(argv)+[egg]) # we're done here
+ finally:
+ if egg and os.path.exists(egg):
+ os.unlink(egg)
+ else:
+ if setuptools.__version__ == '0.0.1':
+ # tell the user to uninstall obsolete version
+ use_setuptools(version)
+
+ req = "setuptools>="+version
+ import pkg_resources
+ try:
+ pkg_resources.require(req)
+ except pkg_resources.VersionConflict:
+ try:
+ from setuptools.command.easy_install import main
+ except ImportError:
+ from easy_install import main
+ main(list(argv)+[download_setuptools(delay=0)])
+ sys.exit(0) # try to force an exit
+ else:
+ if argv:
+ from setuptools.command.easy_install import main
+ main(argv)
+ else:
+ print "Setuptools version",version,"or greater has been installed."
+ print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
+
+
+
+def update_md5(filenames):
+ """Update our built-in md5 registry"""
+
+ import re
+ from md5 import md5
+
+ for name in filenames:
+ base = os.path.basename(name)
+ f = open(name,'rb')
+ md5_data[base] = md5(f.read()).hexdigest()
+ f.close()
+
+ data = [" %r: %r,\n" % it for it in md5_data.items()]
+ data.sort()
+ repl = "".join(data)
+
+ import inspect
+ srcfile = inspect.getsourcefile(sys.modules[__name__])
+ f = open(srcfile, 'rb'); src = f.read(); f.close()
+
+ match = re.search("\nmd5_data = {\n([^}]+)}", src)
+ if not match:
+ print >>sys.stderr, "Internal error!"
+ sys.exit(2)
+
+ src = src[:match.start(1)] + repl + src[match.end(1):]
+ f = open(srcfile,'w')
+ f.write(src)
+ f.close()
+
+
+if __name__=='__main__':
+ if len(sys.argv)>2 and sys.argv[1]=='--md5update':
+ update_md5(sys.argv[2:])
+ else:
+ main(sys.argv[1:])
+
+
+
+
+
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/setup.cfg
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/setup.cfg Mon Jul 9 11:01:55 2007
@@ -0,0 +1,34 @@
+[egg_info]
+tag_build = dev
+tag_svn_revision = true
+
+[easy_install]
+find_links = http://www.pylonshq.com/download/
+
+[pudge]
+theme = pythonpaste.org
+
+# Add extra doc files here with spaces between them
+docs = turbopaste/docs/index.txt
+
+# Doc Settings
+doc_base = turbopaste/docs/
+dest = turbopaste/docs/html
+
+# Add extra modules here separated with commas
+modules = turbopaste
+title = Turbopaste
+organization = Pylons
+
+# Optionally add extra links
+#organization_url = http://pylonshq.com/
+#trac_url = http://pylonshq.com/project
+settings = no_about=true
+
+# Optionally add extra settings
+# link1=/community/ Community
+# link2=/download/ Download
+
+[publish]
+doc-dir=turbopaste/docs/html
+make-dirs=1
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/setup.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/setup.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,21 @@
+from setuptools import setup, find_packages
+
+setup(
+ name='turbopaste',
+ version="",
+ #description="",
+ #author="",
+ #author_email="",
+ #url="",
+ install_requires=["TurboGears2>=2.0a1dev-r3239"],
+ packages=find_packages(exclude=['ez_setup']),
+ include_package_data=True,
+ test_suite = 'nose.collector',
+ package_data={'turbopaste': ['i18n/*/LC_MESSAGES/*.mo']},
+ entry_points="""
+ [paste.app_factory]
+ main=turbopaste:make_app
+ [paste.app_install]
+ main=pylons.util:PylonsInstaller
+ """,
+)
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/test.ini
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/test.ini Mon Jul 9 11:01:55 2007
@@ -0,0 +1,20 @@
+#
+# turbopaste - Pylons testing environment configuration
+#
+# The %(here)s variable will be replaced with the parent directory of this file
+#
+[DEFAULT]
+debug = true
+email_to = you at yourdomain.com
+smtp_server = localhost
+error_email_from = paste at localhost
+
+[server:main]
+use = egg:Paste#http
+host = 0.0.0.0
+port = 5000
+
+[app:main]
+use = config:development.ini
+
+# Add additional test specific configuration options as necessary.
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/__init__.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/__init__.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,8 @@
+"""
+turbopaste
+
+This file loads the finished app from turbopaste.config.middleware.
+
+"""
+
+from turbopaste.config.middleware import make_app
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/__init__.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/__init__.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1 @@
+#
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/environment.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/environment.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,39 @@
+import os
+
+from paste.deploy.config import CONFIG
+
+from pylons import config
+import webhelpers
+
+from turbopaste.config.routing import make_map
+
+def load_environment(global_conf, app_conf):
+ # Create our paths
+ root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+ paths = {'root_path': root_path,
+ 'controllers': os.path.join(root_path, 'controllers'),
+ 'templates': [os.path.join(root_path, path) for path in \
+ ('components', 'templates')],
+ 'static_files': os.path.join(root_path, 'public')
+ }
+
+ # Initialize the other basic options
+ config.init_app(global_conf, app_conf, package='turbopaste',
+ template_engine='genshi', paths=paths)
+
+ map = make_map(config)
+ config['pylons.map'] = map
+
+
+ # Add your own template options config options here, note that all config options will override
+ # any Pylons config options
+
+ # The following template options are passed to your template engines
+ tmpl_options = {}
+
+ # Load-up the template options
+ config['buffet.template_options'] = tmpl_options
+
+ # Setup the Paste CONFIG object for legacy code
+ CONFIG.push_process_config(config._current_obj())
+
\ No newline at end of file
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/middleware.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/middleware.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,53 @@
+from paste.cascade import Cascade
+from paste.urlparser import StaticURLParser
+from paste.registry import RegistryManager
+from paste.deploy.config import ConfigMiddleware
+from paste.deploy.converters import asbool
+
+from pylons.error import error_template
+from pylons import config
+from pylons.middleware import ErrorHandler, ErrorDocuments, StaticJavascripts, error_mapper
+import pylons.wsgiapp
+
+from turbopaste.config.environment import load_environment
+import turbopaste.lib.helpers
+import turbopaste.lib.app_globals as app_globals
+
+def make_app(global_conf, full_stack=True, **app_conf):
+ """Create a WSGI application and return it
+
+ global_conf is a dict representing the Paste configuration options, the
+ paste.deploy.converters should be used when parsing Paste config options
+ to ensure they're treated properly.
+ """
+ # Load our Pylons configuration defaults
+ load_environment(global_conf, app_conf)
+
+ # Load our default Pylons WSGI app and make g available
+ app = pylons.wsgiapp.PylonsApp(helpers=turbopaste.lib.helpers,
+ g=app_globals.Globals)
+
+ app = ConfigMiddleware(app, config._current_obj())
+
+ # YOUR MIDDLEWARE
+ # Put your own middleware here, so that any problems are caught by the error
+ # handling middleware underneath
+
+ # If errror handling will be handled by middleware for multiple apps, you
+ # will want to set full_stack = False in your config file so that it can
+ # catch the problems.
+ if asbool(full_stack):
+ # Error Handling
+ app = ErrorHandler(app, global_conf, error_template=error_template, **config['pylons.errorware'])
+
+ # Display error documents for 401, 403, 404 status codes (if debug is disabled also
+ # intercepts 500)
+ app = ErrorDocuments(app, global_conf, mapper=error_mapper, **app_conf)
+
+ # Establish the Registry for this application
+ app = RegistryManager(app)
+
+ static_app = StaticURLParser(config['pylons.paths']['static_files'])
+ javascripts_app = StaticJavascripts()
+ app = Cascade([static_app, javascripts_app, app])
+ return app
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/routing.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/routing.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,28 @@
+"""Setup your Routes options here"""
+
+import os
+
+from routes import Mapper
+
+
+def make_map(conf={}):
+
+ root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+ map = Mapper(directory=os.path.join(root_path, 'controllers'))
+
+ # This route connects your root controller
+ map.connect('*url', controller='root', action='route')
+
+ # This route handles displaying the error page and graphics used in the 404/500
+ # error pages. It should likely stay at the top to ensure that the error page is
+ # displayed properly.
+
+ map.connect('error/:action/:id', controller='error')
+
+ # Define your routes. The more specific and detailed routes should be defined first,
+ # so they may take precedent over the more generic routes. For more information, refer
+ # to the routes manual @ http://routes.groovie.org/docs/
+
+ map.connect('*url', controller='template', action='view', _encoding=None)
+
+ return map
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/__init__.py
==============================================================================
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/error.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/error.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,32 @@
+import os.path
+from paste import fileapp
+from pylons.middleware import media_path, error_document_template
+from turbopaste.lib.base import *
+
+class ErrorController(BaseController):
+ """
+ Class to generate error documents as and when they are required. This behaviour of this
+ class can be altered by changing the parameters to the ErrorDocuments middleware in
+ your config/middleware.py file.
+ """
+
+ def document(self):
+ """
+ Change this method to change how error documents are displayed
+ """
+ page = error_document_template % {
+ 'prefix': request.environ.get('SCRIPT_NAME', ''),
+ 'code': request.params.get('code', ''),
+ 'message': request.params.get('message', ''),
+ }
+ return Response(page)
+
+ def img(self, id):
+ return self._serve_file(os.path.join(media_path, 'img', id))
+
+ def style(self, id):
+ return self._serve_file(os.path.join(media_path, 'style', id))
+
+ def _serve_file(self, path):
+ fapp = fileapp.FileApp(path)
+ return fapp(request.environ, self.start_response)
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/root.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/root.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,9 @@
+from tg import expose, validate, TurboGearsController
+from pylons.helpers import redirect_to
+
+class RootController(TurboGearsController):
+
+ @expose('turbopaste.templates.index')
+ def index(self):
+ from datetime import datetime
+ return dict(now=datetime.now())
\ No newline at end of file
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/template.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/template.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,28 @@
+from turbopaste.lib.base import *
+
+class TemplateController(BaseController):
+ def view(self, url):
+ """
+ This is the last place which is tried during a request to try to find a
+ file to serve. It could be used for example to display a template::
+
+ def view(self, url):
+ return render_response(url)
+
+ Or, if you're using Myghty and would like to catch the component not
+ found error which will occur when the template doesn't exist; you
+ can use the following version which will provide a 404 if the template
+ doesn't exist::
+
+ import myghty.exception
+
+ def view(self, url):
+ try:
+ return render_response('/'+url)
+ except myghty.exception.ComponentNotFound:
+ return Response(code=404)
+
+ The default is just to abort the request with a 404 File not found
+ status message.
+ """
+ abort(404)
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/docs/index.txt
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/docs/index.txt Mon Jul 9 11:01:55 2007
@@ -0,0 +1,11 @@
+turbopaste
+++++++++++
+
+This is the main index page of your documentation. It should be written in reStructuredText format.
+
+You can generate your documentation in HTML format by running this command::
+
+ setup.py pudge
+
+For this to work you will need to download and install ``buildutils`` and ``pudge``.
+
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/i18n/__init__.py
==============================================================================
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/__init__.py
==============================================================================
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/app_globals.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/app_globals.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,35 @@
+class Globals(object):
+
+ def __init__(self, global_conf, app_conf, **extra):
+ """
+ Globals acts as a container for objects available throughout
+ the life of the application.
+
+ One instance of Globals is created by Pylons during
+ application initialization and is available during requests
+ via the 'g' variable.
+
+ ``global_conf``
+ The same variable used throughout ``config/middleware.py``
+ namely, the variables from the ``[DEFAULT]`` section of the
+ configuration file.
+
+ ``app_conf``
+ The same ``kw`` dictionary used throughout
+ ``config/middleware.py`` namely, the variables from the
+ section in the config file for your application.
+
+ ``extra``
+ The configuration returned from ``load_config`` in
+ ``config/middleware.py`` which may be of use in the setup of
+ your global variables.
+
+ """
+ pass
+
+ def __del__(self):
+ """
+ Put any cleanup code to be run when the application finally exits
+ here.
+ """
+ pass
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/base.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/base.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,19 @@
+from pylons import Response, c, g, cache, request, session
+from pylons.controllers import WSGIController
+from pylons.decorators import jsonify, validate
+from pylons.templating import render, render_response
+from pylons.helpers import abort, redirect_to, etag_cache
+from pylons.i18n import N_, _, ungettext
+import turbopaste.models as model
+import turbopaste.lib.helpers as h
+
+class BaseController(WSGIController):
+ def __call__(self, environ, start_response):
+ # Insert any code to be run per request here. The Routes match
+ # is under environ['pylons.routes_dict'] should you want to check
+ # the action or route vars here
+ return WSGIController.__call__(self, environ, start_response)
+
+# Include the '_' function in the public names
+__all__ = [__name for __name in locals().keys() if not __name.startswith('_') \
+ or __name == '_']
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/database.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/database.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,35 @@
+from pylons.database import create_engine
+
+import elixir
+
+metadata = elixir.metadata
+objectstore = elixir.objectstore
+session_context = objectstore.context
+engine = None
+
+def connect(dburi=None, echo = None):
+ """
+ Connects engine to metadata
+ """
+ global engine
+ engine = create_engine(dburi, echo)
+ metadata.connect(engine)
+ elixir.setup_all()
+
+def resync():
+ """
+ Renews SQLAlchemy session with current thread
+ """
+ del session_context.current
+
+def flush_all():
+ """
+ Flushes all changes to database
+ """
+ objectstore.flush()
+
+# Uncomment these lines if you want to use the "autoload" option with your Elixir models
+# if not metadata.is_bound():
+# elixir.delay_setup = True
+
+__all__ = ['metadata', 'objectstore', 'session_context', 'engine', 'connect', 'resync', 'flush_all']
\ No newline at end of file
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/helpers.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/helpers.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,8 @@
+"""
+Helper functions
+
+All names available in this module will be available under the Pylons h object.
+"""
+from webhelpers import *
+from pylons.helpers import log
+from pylons.i18n import get_lang, set_lang
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/models/__init__.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/models/__init__.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,4 @@
+from turbopaste.lib.database import *
+
+# Import or define your Elixir classes here
+# from elixir import *
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/css/style.css
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/css/style.css Mon Jul 9 11:01:55 2007
@@ -0,0 +1,134 @@
+/*
+ * Quick mash-up of CSS for the TG quick start page.
+ */
+
+html, body {
+ color: black;
+ background-color: #ddd;
+ font: x-small "Lucida Grande", "Lucida Sans Unicode", geneva, verdana, sans-serif;
+ margin: 0;
+ padding: 0;
+}
+
+td, th {padding:3px;border:none;}
+tr th {text-align:left;background-color:#f0f0f0;color:#333;}
+tr.odd td {background-color:#edf3fe;}
+tr.even td {background-color:#fff;}
+
+#header {
+ height: 80px;
+ width: 777px;
+ background: blue URL('../images/header_inner.png') no-repeat;
+ border-left: 1px solid #aaa;
+ border-right: 1px solid #aaa;
+ margin: 0 auto 0 auto;
+}
+
+a.link, a, a.active {
+ color: #369;
+}
+
+
+#main_content {
+ color: black;
+ font-size: 127%;
+ background-color: white;
+ width: 757px;
+ margin: 0 auto 0 auto;
+ border-left: 1px solid #aaa;
+ border-right: 1px solid #aaa;
+ padding: 10px;
+}
+
+#sidebar {
+ border: 1px solid #aaa;
+ background-color: #eee;
+ margin: 0.5em;
+ padding: 1em;
+ float: right;
+ width: 200px;
+ font-size: 88%;
+}
+
+#sidebar h2 {
+ margin-top: 0;
+}
+
+#sidebar ul {
+ margin-left: 1.5em;
+ padding-left: 0;
+}
+
+h1,h2,h3,h4,h5,h6,#getting_started_steps {
+ font-family: "Century Schoolbook L", Georgia, serif;
+ font-weight: bold;
+}
+
+h2 {
+ font-size: 150%;
+}
+
+#getting_started_steps a {
+ text-decoration: none;
+}
+
+#getting_started_steps a:hover {
+ text-decoration: underline;
+}
+
+#getting_started_steps li {
+ font-size: 80%;
+ margin-bottom: 0.5em;
+}
+
+#getting_started_steps h2 {
+ font-size: 120%;
+}
+
+#getting_started_steps p {
+ font: 100% "Lucida Grande", "Lucida Sans Unicode", geneva, verdana, sans-serif;
+}
+
+#footer {
+ border: 1px solid #aaa;
+ border-top: 0px none;
+ color: #999;
+ background-color: white;
+ padding: 10px;
+ font-size: 80%;
+ text-align: center;
+ width: 757px;
+ margin: 0 auto 1em auto;
+}
+
+.code {
+ font-family: monospace;
+}
+
+span.code {
+ font-weight: bold;
+ background: #eee;
+}
+
+#status_block {
+ margin: 0 auto 0.5em auto;
+ padding: 15px 10px 15px 55px;
+ background: #cec URL('../images/ok.png') left center no-repeat;
+ border: 1px solid #9c9;
+ width: 450px;
+ font-size: 120%;
+ font-weight: bolder;
+}
+
+.notice {
+ margin: 0.5em auto 0.5em auto;
+ padding: 15px 10px 15px 55px;
+ width: 450px;
+ background: #eef URL('../images/info.png') left center no-repeat;
+ border: 1px solid #cce;
+}
+
+.fielderror {
+ color: red;
+ font-weight: bold;
+}
\ No newline at end of file
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/favicon.ico
==============================================================================
Binary file. No diff available.
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/header_inner.png
==============================================================================
Binary file. No diff available.
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/info.png
==============================================================================
Binary file. No diff available.
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/ok.png
==============================================================================
Binary file. No diff available.
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/tg_under_the_hood.png
==============================================================================
Binary file. No diff available.
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/under_the_hood_blue.png
==============================================================================
Binary file. No diff available.
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/__init__.py
==============================================================================
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/index.html
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/index.html Mon Jul 9 11:01:55 2007
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:py="http://genshi.edgewall.org/"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+
+<xi:include href="master.html" />
+
+<head>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
+ <title>Welcome to TurboGears 2.0, standing on the
+ shoulders of giants, since 2007</title>
+</head>
+
+<body>
+ <div id="status_block" class="flash">Your application is now running</div>
+ <div id="sidebar">
+ <h2>Contribute</h2>
+ Get help
+ <ul class="links">
+ <li><a href="http://docs.turbogears.org">Documents</a></li>
+ <li><a href="http://docs.turbogears.org">API</a></li>
+ <li><a href="http://trac.turbogears.org/turbogears/">Bug Tracker</a></li>
+ <li><a href="http://groups.google.com/group/turbogears">Mail List</a> </li>
+ </ul>
+ <span py:replace="now">now</span>
+ </div>
+ <div id="getting_started">
+ <ol id="getting_started_steps">
+ <li class="getting_started">
+ <h3>Code your data model</h3>
+ <p> Code your data model, Create the database, and Add some bootstrap data.</p>
+ </li>
+ <li class="getting_started">
+ <h3>Design your URLs</h3>
+ <p> Design your URLs, Write your controller methods, Write your
+ templates, and Add some static files (CSS and/or JavaScript). </p>
+ </li>
+ <li class="getting_started">
+ <h3>Build an distribution</h3>
+ <p> Build an distribution. </p>
+ </li>
+ </ol>
+ <div class="notice"> TurboGears is an opensource project, help yourself to
+ make turbogears better and make your life easier.</div>
+ </div>
+</body>
+</html>
\ No newline at end of file
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/master.html
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/master.html Mon Jul 9 11:01:55 2007
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:py="http://genshi.edgewall.org/"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ py:strip="">
+
+<head py:match="head" py:attrs="select('@*')">
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
+ <title py:replace="''">Your title goes here</title>
+ <meta py:replace="select('*')"/>
+ <link rel="stylesheet" type="text/css" media="screen" href="/css/style.css" />
+</head>
+
+<body py:match="body" py:attrs="select('@*')">
+ <div id="header"> </div>
+ <div id="main_content">
+ <div py:replace="select('*|text()')"/>
+ </div>
+ <div id="footer">
+ <img src="images/under_the_hood_blue.png" alt="TurboGears" />
+ <p>TurboGears 2 is a open source front-to-back web development
+ framework written in Python</p>
+ <p>Copyright (c) 2005-2007 </p>
+ </div>
+</body>
+
+</html>
\ No newline at end of file
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/__init__.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/__init__.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,34 @@
+import os
+import sys
+from unittest import TestCase
+
+here_dir = os.path.dirname(os.path.abspath(__file__))
+conf_dir = os.path.dirname(os.path.dirname(here_dir))
+
+sys.path.insert(0, conf_dir)
+
+import pkg_resources
+
+pkg_resources.working_set.add_entry(conf_dir)
+
+pkg_resources.require('Paste')
+pkg_resources.require('PasteScript')
+
+from paste.deploy import loadapp
+import paste.fixture
+import paste.script.appinstall
+
+from turbopaste.config.routing import *
+from routes import request_config, url_for
+
+test_file = os.path.join(conf_dir, 'test.ini')
+cmd = paste.script.appinstall.SetupCommand('setup-app')
+cmd.run([test_file])
+
+class TestController(TestCase):
+ def __init__(self, *args):
+ wsgiapp = loadapp('config:test.ini', relative_to=conf_dir)
+ self.app = paste.fixture.TestApp(wsgiapp)
+ TestCase.__init__(self, *args)
+
+__all__ = ['url_for', 'TestController']
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/functional/__init__.py
==============================================================================
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/test_models.py
==============================================================================
Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/websetup.py
==============================================================================
--- (empty file)
+++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/websetup.py Mon Jul 9 11:01:55 2007
@@ -0,0 +1,10 @@
+import paste.deploy
+
+def setup_config(command, filename, section, vars):
+ """
+ Place any commands to setup turbopaste here.
+ """
+ conf = paste.deploy.appconfig('config:' + filename)
+ conf.update(dict(app_conf=conf.local_conf, global_conf=conf.global_conf))
+ paste.deploy.CONFIG.push_process_config(conf)
+
More information about the z3-checkins
mailing list