Skip to content

Commit

Permalink
pep8 + pyflakes, update changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
janjaapdriessen committed Jun 28, 2011
1 parent eb71c73 commit e3e270a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGES.txt
Expand Up @@ -5,7 +5,7 @@ CHANGES
0.11 (unreleased)
-----------------

- Nothing changed yet.
- Added nl translations.


0.10 (2011-02-08)
Expand Down
2 changes: 1 addition & 1 deletion buildout.cfg
@@ -1,5 +1,5 @@
[buildout]
extends = http://download.zope.org/zopetoolkit/index/1.1c1/ztk-versions.cfg
extends = http://download.zope.org/zopetoolkit/index/1.1.1/ztk-versions.cfg
develop = .
parts =
test
Expand Down
7 changes: 7 additions & 0 deletions src/zope/__init__.py
@@ -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__)
3 changes: 2 additions & 1 deletion src/zope/errorview/browser.py
Expand Up @@ -14,13 +14,14 @@

from zope.authentication.interfaces import IAuthentication
from zope.component import getUtility
from zope.errorview.http import ExceptionViewBase, ExceptionView
from zope.errorview.http import ExceptionViewBase
from zope.errorview.http import UnauthorizedView
from zope.publisher.browser import BrowserPage

from zope.errorview.i18n import _
from zope.i18n import translate


class ExceptionView(ExceptionViewBase, BrowserPage):

def render(self):
Expand Down
2 changes: 2 additions & 0 deletions src/zope/errorview/interfaces.py
@@ -1,10 +1,12 @@
from zope.interface import Interface, implements, Attribute


class IHandleExceptionEvent(Interface):
"""Event fired when handling an exception."""

request = Attribute('The current request')


class HandleExceptionEvent(object):
implements(IHandleExceptionEvent)

Expand Down
1 change: 0 additions & 1 deletion src/zope/errorview/tests/test_browser.py
Expand Up @@ -14,7 +14,6 @@

from unittest import TestCase
from zope.authentication.interfaces import IAuthentication
from zope.browser.interfaces import ISystemErrorView
from zope.component import getUtility, getMultiAdapter
from zope.component.testlayer import ZCMLFileLayer
from zope.interface import implements
Expand Down
2 changes: 1 addition & 1 deletion src/zope/errorview/tests/test_event.py
Expand Up @@ -27,7 +27,7 @@ def setUp(self):
self.request = HTTPRequest('', {})

def test_event(self):
view = ExceptionViewBase(Exception(), self.request)()
ExceptionViewBase(Exception(), self.request)()
event = zope.component.eventtesting.getEvents()[0]
self.assertEqual(event.request, self.request)
self.assertTrue(IHandleExceptionEvent.providedBy(event))
8 changes: 5 additions & 3 deletions src/zope/errorview/tests/test_http.py
Expand Up @@ -48,7 +48,8 @@ def test_exceptionview(self):
self.assertEqual(self.request.response.getStatus(), 500)

def test_systemerrormixin_view(self):
class SystemErrorView(http.ExceptionViewBase, http.SystemErrorViewMixin):
class SystemErrorView(http.ExceptionViewBase,
http.SystemErrorViewMixin):
pass
view = SystemErrorView(Exception(), self.request)
self.failUnless(IHTTPException.providedBy(view))
Expand Down Expand Up @@ -130,8 +131,9 @@ def test_traversalexceptionview(self):
# XXX test the MKCOL verb here too.

def test_notfound(self):
view = getMultiAdapter(
(NotFound(object(), self.request), self.request), name='index.html')
view = getMultiAdapter((NotFound(object(), self.request),
self.request),
name='index.html')
self.failUnless(IHTTPException.providedBy(view))
self.assertEquals(view(), '')
self.assertEqual(self.request.response.getStatus(), 404)
Expand Down

0 comments on commit e3e270a

Please sign in to comment.