Skip to content

Commit

Permalink
Project code
Browse files Browse the repository at this point in the history
  • Loading branch information
philikon committed Jun 2, 2007
0 parents commit 7808149
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
``paste.evalexception`` lets you interactively debug exceptions in
your WSGI app. ``z3c.evalexception`` is a small wrapper around that
so that it works with the stock Zope 3 application server.

Here's a simple PasteDeploy configuration file that sets up the Zope 3
application server on top of the WSGIUtils HTTP server with the
``z3c.evalexception`` middleware::

[filter-app:main]
use = egg:z3c.evalexception
next = zope

[app:zope]
use = egg:zope.paste
site_definition = parts/app/site.zcml
file_storage = parts/data/Data.fs

[server:main]
use = egg:PasteScript#wsgiutils
host = 127.0.0.1
port = 8080
18 changes: 18 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from setuptools import setup, find_packages

setup(name='z3c.evalexception',
version = '1.0',
license='ZPL 2.1',
description="Paste's interactive exception debugger for Zope 3",
author='Philipp von Weitershausen',
author_email='philipp@weitershausen.de',
long_description=open('README.txt').read(),
packages=find_packages(),
namespace_packages=['z3c'],
install_requires=['setuptools', 'Paste'],
zip_safe=True,
entry_points="""
[paste.filter_app_factory]
main = z3c.evalexception:zope_eval_exception
"""
)
7 changes: 7 additions & 0 deletions z3c/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
10 changes: 10 additions & 0 deletions z3c/evalexception.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from paste.evalexception.middleware import EvalException

class ZopeEvalException(EvalException):

def __call__(self, environ, start_response):
environ['wsgi.handleErrors'] = False
return super(ZopeEvalException, self).__call__(environ, start_response)

def zope_eval_exception(app, global_conf):
return ZopeEvalException(app)

0 comments on commit 7808149

Please sign in to comment.