Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
kiorky committed Feb 22, 2012
1 parent d7e42f1 commit a8fd0c1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/HISTORY.txt
Expand Up @@ -4,7 +4,7 @@ Changelog
1.11 (unreleased)
-----------------

- Nothing changed yet.
- add weberror wrapper


1.10 (2012-02-22)
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -44,6 +44,7 @@ def read(*rnames):
package_dir = {'': 'src'},
install_requires=[
#'setuptools',
"WebError",
'WebOb',
'PasteScript',
'Django',
Expand Down
13 changes: 13 additions & 0 deletions src/dj/paste/paste.py
Expand Up @@ -9,6 +9,8 @@
dv = pkg_resources.working_set.by_key.get('django').version
MIN_VERSION = '1.0.3'

from weberror.evalexception import make_eval_exception

from django.core.handlers.wsgi import WSGIHandler
from django import conf

Expand Down Expand Up @@ -140,3 +142,14 @@ def django_multi_factory(global_config, **local_config):
local_config['multi'] = 'true'
return django_factory(global_config, **local_config)


def weberror_wrapper(app, global_config, **local_config):
keys = ['error_email', 'from_address', 'show_exceptions',
'smtp_server', 'smtp_use_tls', 'smtp_username ',
'smtp_password ', 'error_subject_prefix',]
for k in keys:
if k in local_config:
del local_config[k]
return make_eval_exception(app, global_config, **local_config)


0 comments on commit a8fd0c1

Please sign in to comment.