Skip to content

Commit

Permalink
PEP-8
Browse files Browse the repository at this point in the history
  • Loading branch information
sallner committed Sep 29, 2016
1 parent f09eb19 commit 678ea04
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/grokcore/view/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ def render(self, **kwargs):

render.base_method = True


# backwards compatibility. Probably not needed by many, but just in case.
# please start using grokcore.view.View again.
CodeView = View



@interface.implementer(interfaces.ITemplate)
class BaseTemplate(object):
"""Any sort of page template"""
Expand Down Expand Up @@ -256,7 +256,7 @@ def __init__(self, context, request, view):
self.request,
interface.Interface,
name=self.module_info.package_dotted_name,
)
)

def default_namespace(self):
namespace = {}
Expand Down
2 changes: 1 addition & 1 deletion src/grokcore/view/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def grok(module_name):
config.execute_actions()


lastwarning = '' # Here we collect warnings.
lastwarning = '' # Here we collect warnings.


def warn(message, category=None, stacklevel=1):
Expand Down
16 changes: 8 additions & 8 deletions src/grokcore/view/tests/template/pluggability.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Testing the plugging in of a template language
>>> grok.testing.grok(__name__)
>>> cave = Cave()
>>> from zope.publisher.browser import TestRequest
>>> request = TestRequest()
>>> from zope import component
# The inline template should work:
>>> view = component.getMultiAdapter((cave, request), name='sebaayeni')
>>> print view()
Expand All @@ -23,7 +23,7 @@
>>> print view()
<html><body>Kakadu is in Australia</body></html>
# We should be able to extend the namespac in the view and
# We should be able to extend the namespac in the view and
>>> view = component.getMultiAdapter((cave, request), name='sierra')
>>> print view()
<html><body>Sierra de San Fransisco is in Mexico</body></html>
Expand All @@ -33,10 +33,10 @@

# Dummy template language:
class MyTemplate(object):

def __init__(self, text):
self._text = text

def render(self, **kw):
# Silliest template language ever:
return self._text % kw
Expand Down Expand Up @@ -70,19 +70,19 @@ class Cave(grok.Context):

class Sebaayeni(grok.View):
pass

sebaayeni = MyPageTemplate('<html><body>Sebaayeni is in South Africa</body></html>')

class Lascaux(grok.View):
pass

lascaux = MyPageTemplate(filename='lascaux.html')

class Kakadu(grok.View):
pass

class Sierra(grok.View):

def namespace(self):
return {'cave': 'Sierra de San Fransisco',
'country': 'Mexico'}
2 changes: 1 addition & 1 deletion src/grokcore/view/tests/view/dirtemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Templates can also be found in a directory with the same name as the module:
>>> grok.testing.grok(__name__)
>>> manfred = Mammoth()
>>> from zope.publisher.browser import TestRequest
>>> request = TestRequest()
Expand Down
2 changes: 1 addition & 1 deletion src/grokcore/view/tests/view/inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using a variable named `viewname_pt`:
>>> grok.testing.grok(__name__)
>>> manfred = Mammoth()
>>> from zope.publisher.browser import TestRequest
>>> request = TestRequest()
Expand Down
2 changes: 1 addition & 1 deletion src/grokcore/view/tests/view/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<h1>red</h1>
</body>
</html>
"""
import grokcore.view as grok
Expand Down
1 change: 0 additions & 1 deletion src/grokcore/view/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from urllib import quote, urlencode
from urlparse import urlparse, urlunparse


from grokcore.security.util import check_permission
from zope.component import getMultiAdapter
from zope.security.checker import NamesChecker, defineChecker
Expand Down

0 comments on commit 678ea04

Please sign in to comment.