Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Apr 26, 2017
1 parent e9dfcbb commit ae8e28b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -65,7 +65,7 @@ def read(*rnames):
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Framework :: Zope3',
Expand Down
1 change: 0 additions & 1 deletion src/zope/app/form/browser/formview.py
Expand Up @@ -44,7 +44,6 @@ def getData(self):
This method should return a dictionary mapping field names to values.
"""
# pragma: no cover
raise NotImplementedError('Must be implemented by a specific form class')

def setData(self, data):
Expand Down
1 change: 1 addition & 0 deletions src/zope/app/form/browser/metaconfigure.py
Expand Up @@ -71,6 +71,7 @@ def __init__(self, _context, **kwargs):
# returned from the filesystem) And on Python 3, bytes
# != str so the utilities can't be found. So we have
# to correct this if we want our translations to work.
# See https://github.com/zopefoundation/zope.configuration/issues/17
if (bytes is not str
and hasattr(value, 'domain')
and isinstance(value.domain, bytes)):
Expand Down
5 changes: 3 additions & 2 deletions src/zope/app/form/browser/tests/test_functional_i18n.py
Expand Up @@ -75,8 +75,9 @@ class FieldContent(Persistent):

class _FakeResponse(FakeResponse):
if str is bytes:
# py2 has a bug, assuming headers are in unicode already, or
# are decodable implicitly to ascii
# Up through at least 4.0.0 of zope.app.wsgi, Py2 has a bug,
# assuming headers are in unicode already, or are decodable
# implicitly to ascii
def getHeaders(self):
headers = super(_FakeResponse, self).getHeaders()
result = []
Expand Down
13 changes: 6 additions & 7 deletions src/zope/app/form/browser/widgets.rst
Expand Up @@ -47,24 +47,23 @@ The implementation is shown in the ``poll.py`` source below::
>>> @implementer(IPoll)
... class Poll(Persistent, object):
...
...
... def getResponse(self, option):
... def getResponse(self, option):
... return self._responses[option]
...
... def choose(self, option):
... def choose(self, option):
... self._responses[option] += 1
... self._p_changed = 1
...
... def get_options(self):
... @property
... def options(self):
... return self._options
...
... def set_options(self, options):
... @options.setter
... def set_options(self, options):
... self._options = options
... self._responses = {}
... for option in self._options:
... self._responses[option.label] = 0
...
... options = property(get_options, set_options, None, 'fiddle options')



Expand Down
2 changes: 1 addition & 1 deletion src/zope/app/form/tests/test_utility.py
Expand Up @@ -489,7 +489,7 @@ def test_names(self):
for a view:
>>> view = BrowserView(Content(), request)
>>> sorted(list(IContent.names()))
>>> sorted(IContent.names())
['bar', 'foo']
>>> setUpWidgets(view, IContent, IWidget, names=('bar',))
>>> hasattr(view, 'foo_widget')
Expand Down

0 comments on commit ae8e28b

Please sign in to comment.