Skip to content

Commit

Permalink
Fix linting errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed May 15, 2020
1 parent 18bb403 commit 125cca7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
14 changes: 12 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

from setuptools import setup, find_packages


def read(*rnames):
with open(os.path.join(os.path.dirname(__file__), *rnames)) as f:
return f.read()


setup(
name='zope.browser',
version='2.4.dev0',
Expand All @@ -42,10 +44,10 @@ def read(*rnames):
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
Expand All @@ -56,7 +58,15 @@ def read(*rnames):
url='https://zopebrowser.readthedocs.io',
packages=find_packages('src'),
package_dir={'': 'src'},
namespace_packages=['zope',],
namespace_packages=['zope'],
python_requires=', '.join([
'>=2.7',
'!=3.0.*',
'!=3.1.*',
'!=3.2.*',
'!=3.3.*',
'!=3.4.*',
]),
install_requires=[
'setuptools',
'zope.interface',
Expand Down
8 changes: 1 addition & 7 deletions src/zope/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
__import__('pkg_resources').declare_namespace(__name__) # pragma: nocover
19 changes: 11 additions & 8 deletions src/zope/browser/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,30 @@
##############################################################################
"""Shared dependency less Zope3 brwoser components.
"""
__docformat__ = 'restructuredtext'

from zope.interface import Attribute
from zope.interface import Interface


class IView(Interface):
""" Views are multi-adapters for context and request objects.
"""
context = Attribute("The context object the view renders")
request = Attribute("The request object driving the view")


class IBrowserView(IView):
""" Views which are specialized for requests from a browser
Such views are distinct from those geerated via WebDAV, FTP, XML-RPC,
etc.
"""


class IAdding(IBrowserView):
""" Multi-adapter interface for views which add items to containers.
The 'context' of the view must implement :obj:`zope.container.interfaces.IContainer`.
The 'context' of the view must implement
:obj:`zope.container.interfaces.IContainer`.
"""

def add(content):
Expand Down Expand Up @@ -68,8 +70,7 @@ def nextURL():
"""

def nameAllowed():
"""Return whether names can be input by the user.
"""
"""Return whether names can be input by the user."""

def addingInfo():
"""Return add menu data as a sequence of mappings.
Expand All @@ -83,7 +84,9 @@ def isSingleMenuItem():
"""Return whether there is single menu item or not."""

def hasCustomAddView():
"This should be called only if there is ``singleMenuItem`` else return 0"
"""This should be called only if there is ``singleMenuItem``
else return 0.
"""


class ITerms(Interface):
Expand All @@ -103,10 +106,10 @@ def getValue(token):
LookupError is raised if there isn't a value in the source.
"""


class ISystemErrorView(Interface):
"""Error views that can classify their contexts as system errors
"""

def isSystemError():
"""Return a boolean indicating whether the error is a system errror
"""
"""Return a boolean indicating whether the error is a system error."""
6 changes: 1 addition & 5 deletions src/zope/browser/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ def test_suite():
return unittest.TestSuite((
doctest.DocFileSuite(
'README.rst',
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
),
))


if __name__ == '__main__':
unittest.main(defaultTest='test_suite')

0 comments on commit 125cca7

Please sign in to comment.