Skip to content

Commit

Permalink
Merge branch 'master' into fix-plone.app.folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Apr 6, 2018
2 parents f8ff6aa + eec4d7c commit 39a867a
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 29 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
@@ -0,0 +1,6 @@
[run]
branch = True
source = src

[report]
precision = 2
12 changes: 9 additions & 3 deletions .gitignore
@@ -1,19 +1,25 @@
*.egg-info
*.py?
.Python
.coverage
.coverage.*
.installed*.cfg
.mr.developer.cfg
.tox
/bin/
/build/
/develop/
/develop-eggs/
/develop/
/dist/
/docs/.build/
/docs/_build/
/eggs/
/etc/
/htmlcov/
/include/
/lib/
/log/
/parts/
/var/
/docs/_build/
/docs/.build/
coverage.xml
pip-selfcheck.json
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -9,11 +9,13 @@ install:
- pip install -U setuptools==`grep setuptools versions.cfg | awk '{print $3}'`
- pip install six==`grep '^six' versions-prod.cfg | awk '{print $3}'`
- pip install zc.buildout==`grep '^zc.buildout' versions.cfg | awk '{print $3}'`
- pip install coveralls coverage
- buildout bootstrap
- buildout install test alltests
script:
- bin/alltests -v
- coverage run bin/alltests -v
after_success:
- coveralls
# Bails out for non-tags
- ./update_index.sh
notifications:
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.rst
Expand Up @@ -16,6 +16,11 @@ https://github.com/zopefoundation/Zope/blob/4.0a6/CHANGES.rst
an acquisition wrapper.
[davisagli]

- Fix an edge case where the data which was set using ``response.write()`` was
not returned by ``publish_module``.

- Fix renaming of images and files via ZMI. (#247).


4.0b3 (2018-01-27)
------------------
Expand Down
14 changes: 8 additions & 6 deletions README.rst
Expand Up @@ -6,11 +6,11 @@
:alt: Documentation Status

.. image:: https://img.shields.io/pypi/v/Zope.svg
:target: https://pypi.python.org/pypi/Zope
:target: https://pypi.org/project/Zope/
:alt: PyPI

.. image:: https://img.shields.io/pypi/pyversions/Zope.svg
:target: https://pypi.python.org/pypi/Zope
:target: https://pypi.org/project/Zope/
:alt: Python versions

.. contents::
Expand All @@ -28,14 +28,16 @@ Documentation can be found at https://zope.readthedocs.io.
Installation
============

Installation information can be found at
https://zope.readthedocs.io/en/latest/INSTALL-buildout.html

Note that you *cannot* simply do ``pip install Zope``, because you need
You *cannot* simply do ``pip install Zope``, because you need
specific versions of all dependencies. Follow the documentation to
ensure you get the correct versions, or else installation is very
likely to fail.

Zope can either be installed using:

* `zc.buildout`, see https://zope.readthedocs.io/en/latest/INSTALL-buildout.html
* `virtualenv` and `pip`, see https://zope.readthedocs.io/en/latest/INSTALL-virtualenv.html

License
=======

Expand Down
5 changes: 0 additions & 5 deletions README.txt

This file was deleted.

6 changes: 3 additions & 3 deletions docs/INSTALL-virtualenv.rst
Expand Up @@ -21,13 +21,13 @@ Install the Zope Software Packages
----------------------------------

Look for the release you want to install on
https://github.com/zopefoundation/Zope/releases. Than use the specific
version in the URL, replacing 4.0b1 in the example below:
https://zopefoundation.github.io/Zope/. Than use the specific
version of ``requirements-full.txt`` in the URL, replacing 4.0b3 in the example below:

.. code-block:: sh
$ bin/pip install \
-r https://raw.githubusercontent.com/zopefoundation/Zope/4.0b1/requirements-full.txt
-r https://zopefoundation.github.io/Zope/releases/4.0b3/requirements-full.txt
Obtaining Zope
...
Successfully installed ...
Expand Down
5 changes: 5 additions & 0 deletions docs/zdgbook/ObjectPublishing.rst
Expand Up @@ -926,6 +926,11 @@ Record marshalling provides you with the ability to create complex
forms. However, it is a good idea to keep your web interfaces as
simple as possible.

Please note, that records do not work with input fields of type radio as you
might expect, as all radio fields with the same name are considered as one
group - even if they are in different records. That means, activating one radio
button will also deactivate all other radio buttons from the other records.

Exceptions
----------

Expand Down
7 changes: 5 additions & 2 deletions setup.py
Expand Up @@ -40,17 +40,20 @@ def _read_file(filename):
classifiers=[
'Development Status :: 6 - Mature',
"Environment :: Web Environment",
"Framework :: Zope2",
"Framework :: Zope :: 4",
"Intended Audience :: Developers",
"License :: OSI Approved :: Zope Public License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"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 :: Implementation :: CPython",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
"Topic :: Software Development :: Libraries :: Application Frameworks",
],
packages=find_packages('src'),
namespace_packages=['Products', 'Shared', 'Shared.DC'],
Expand Down
4 changes: 2 additions & 2 deletions src/OFS/ObjectManager.py
Expand Up @@ -14,6 +14,7 @@
"""

from io import BytesIO
from operator import itemgetter
from logging import getLogger
import copy
import fnmatch
Expand Down Expand Up @@ -210,8 +211,7 @@ def __class_init__(self):
mt.append(t)
except Exception:
pass
mt.sort()
self.meta_types = tuple(mt)
self.meta_types = tuple(sorted(mt, key=itemgetter('name')))

InitializeClass(self)

Expand Down
6 changes: 3 additions & 3 deletions src/OFS/dtml/renameForm.dtml
Expand Up @@ -12,14 +12,14 @@
<td align="left" valign="bottom" width="16"></td>
<td align="left" valign="bottom">
<div class="form-text">
&dtml-id;
&dtml-getId;
</div>
</td>
<td align="left" valign="bottom">
<dtml-if cb_isMoveable>
<span class="form-text">to:</span>
<input type="hidden" name="ids:list" value="&dtml-id;" />
<input type="text" name="new_ids:list" size="<dtml-var "_.max(40,_.len(getId())+4)">" value="&dtml-id;" />
<input type="hidden" name="ids:list" value="&dtml-getId;" />
<input type="text" name="new_ids:list" size="<dtml-var "_.max(40,_.len(getId())+4)">" value="&dtml-getId;" />
<dtml-else>
<span class="form-text">
may not be renamed.
Expand Down
4 changes: 2 additions & 2 deletions src/ZPublisher/WSGIPublisher.py
Expand Up @@ -276,8 +276,8 @@ def publish_module(environ, start_response,
result = response.body
else:
# If somebody used response.write, that data will be in the
# stdout BytesIO, so we put that before the body.
result = (stdout.getvalue(), response.body)
# response.stdout BytesIO, so we put that before the body.
result = (response.stdout.getvalue(), response.body)

for func in response.after_list:
func()
Expand Down
17 changes: 17 additions & 0 deletions src/ZPublisher/tests/test_WSGIPublisher.py
Expand Up @@ -10,6 +10,7 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
import io
import unittest

import transaction
Expand Down Expand Up @@ -296,6 +297,19 @@ def test_publish_can_return_new_response(self):
self.assertEqual(_after1._called_with, ((), {}))
self.assertEqual(_after2._called_with, ((), {}))

def test_publish_returns_data_witten_to_response_before_body(self):
# This also happens if publish creates a new response object.
from ZPublisher.HTTPResponse import WSGIResponse
environ = self._makeEnviron()
start_response = DummyCallable()
def _publish(request, mod_info):
response = WSGIResponse()
response.write(b'WRITTEN')
response.body = b'BODY'
return response
app_iter = self._callFUT(environ, start_response, _publish)
self.assertEqual(app_iter, (b'WRITTEN', b'BODY'))

def test_raises_unauthorized(self):
from zExceptions import Unauthorized
environ = self._makeEnviron()
Expand Down Expand Up @@ -637,6 +651,9 @@ class DummyResponse(object):
_status = '204 No Content'
_headers = [('Content-Length', '0')]

def __init__(self):
self.stdout = io.BytesIO()

def finalize(self):
self._finalized = True
return self._status, self._headers
Expand Down
20 changes: 18 additions & 2 deletions tox.ini
@@ -1,12 +1,28 @@
[tox]
envlist = py27,py34,py35,py36
envlist = py27,py34,py35,py36,coverage-report

[testenv]
commands =
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} bootstrap
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test alltests
{envbindir}/alltests []
coverage run {envbindir}/alltests []
skip_install = true
deps =
coverage
setuptools==33.1.1
zc.buildout
setenv =
COVERAGE_FILE=.coverage.{envname}

[testenv:coverage-report]
basepython = python3.6
deps = coverage
setenv =
COVERAGE_FILE=.coverage
skip_install = true
commands =
coverage erase
coverage combine
coverage html -i
coverage xml -i
coverage report -i --fail-under=79

0 comments on commit 39a867a

Please sign in to comment.