Skip to content

Commit

Permalink
Merge pull request #10 from zopefoundation/support-Zope-5
Browse files Browse the repository at this point in the history
Support Zope 5
  • Loading branch information
Michael Howitz committed Oct 26, 2020
2 parents 36fe931 + 465eeeb commit 63ec380
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ bin
build
develop-eggs
dist
htmlcov/
include
lib
man
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog
2.2 (unreleased)
----------------

- Nothing changed yet.
- Add support for Zope 5.


2.1 (2019-03-05)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'Development Status :: 6 - Mature',
"Environment :: Web Environment",
"Framework :: Zope :: 4",
"Framework :: Zope :: 5",
"Intended Audience :: Developers",
"License :: OSI Approved :: Zope Public License",
"Operating System :: OS Independent",
Expand Down Expand Up @@ -51,7 +52,7 @@
'zope.publisher',
'zope.schema',
'ExtensionClass',
'Zope',
'Zope >= 4',
],
zip_safe=False,
)
13 changes: 12 additions & 1 deletion src/five/formlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,20 @@
from zope.app.form.utility import getWidgetsData

from Products.Five.browser import BrowserView
from Products.Five.browser.decode import processInputs, setPageEncoding
from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile

try:
# Zope 4.x
from Products.Five.browser.decode import processInputs, setPageEncoding
except ImportError:
# Zope 5.x
def processInputs(*args):
pass

def setPageEncoding(*args):
pass


_ = MessageFactory('zope')


Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ pip_pre = true
commands =
zope-testrunner --test-path=src []
deps = zope.testrunner
py35: Zope < 5.0.dev0

[testenv:coverage]
usedevelop = true
basepython = python3.6
commands =
coverage run -m zope.testrunner --test-path=src []
coverage report --show-missing --fail-under=96
coverage html
coverage report --show-missing --fail-under=89
deps =
zope.testrunner
coverage
Expand Down

0 comments on commit 63ec380

Please sign in to comment.