[Testbot] Plone 5.0 - Python 2.7 - Build # 3108 - Regression! - 0 failure(s)
jenkins at plone.org
jenkins at plone.org
Mon Aug 25 23:50:37 UTC 2014
-------------------------------------------------------------------------------
Plone 5.0 - Python 2.7 - Build # 3108 - Still Failing!
-------------------------------------------------------------------------------
http://jenkins.plone.org/job/plone-5.0-python-2.7/3108/
-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------
Repository: plone.namedfile
Branch: refs/heads/master
Date: 2014-08-26T00:24:16+02:00
Author: Gil Forcada (gforcada) <gforcada at gnome.org>
Commit: https://github.com/plone/plone.namedfile/commit/e463604f1e01ab0609be609e648b410418202573
Whitespaces cleanup
Files changed:
M README.rst
M docs/INSTALL.txt
M plone/namedfile/browser.py
M plone/namedfile/configure.zcml
M plone/namedfile/handler.py
M plone/namedfile/handler.txt
M plone/namedfile/handler.zcml
M plone/namedfile/interfaces.py
M plone/namedfile/marshaler.py
M plone/namedfile/marshaler.txt
M plone/namedfile/scaling.zcml
M plone/namedfile/storages.py
M plone/namedfile/tests/test_blobfile.py
M plone/namedfile/tests/test_doctests.py
M plone/namedfile/tests/testing.zcml
M plone/namedfile/usage.txt
diff --git a/README.rst b/README.rst
index 366fa8a..1bee8f9 100644
--- a/README.rst
+++ b/README.rst
@@ -5,14 +5,14 @@ This package contains fields and wrapper objects for storing:
* A file with a filename
* An image with a filename
-
+
Blob-based and non-blob-based types are provided. The blob-based types
require the ZODB3 package to be at version 3.8.1 or later,
and BLOBs to be configured in zope.conf.
-
+
plone.supermodel handlers are registered if plone.supermodel is installed.
The [supermodel] extra will ensure this.
-
+
See the usage.txt doctest for more details.
Note: This packages is licensed under a BSD license. Contributors, please do
diff --git a/docs/INSTALL.txt b/docs/INSTALL.txt
index f1b0ce9..c7de794 100644
--- a/docs/INSTALL.txt
+++ b/docs/INSTALL.txt
@@ -4,7 +4,7 @@ plone.namedfile Installation
To install plone.namedfile into the global Python environment (or a workingenv),
using a traditional Zope 2 instance, you can do this:
-* When you're reading this you have probably already run
+* When you're reading this you have probably already run
``easy_install plone.namedfile``. Find out how to install setuptools
(and EasyInstall) here:
http://peak.telecommunity.com/DevCenter/EasyInstall
@@ -26,7 +26,7 @@ recipe to manage your project, you can do this:
eggs =
...
plone.namedfile
-
+
* Tell the plone.recipe.zope2instance recipe to install a ZCML slug:
[instance]
@@ -34,10 +34,10 @@ recipe to manage your project, you can do this:
...
zcml =
plone.namedfile
-
+
* Re-run buildout, e.g. with:
$ ./bin/buildout
-
+
You can skip the ZCML slug if you are going to explicitly include the package
from another package's configure.zcml file.
diff --git a/plone/namedfile/browser.py b/plone/namedfile/browser.py
index 838900e..190d7e4 100644
--- a/plone/namedfile/browser.py
+++ b/plone/namedfile/browser.py
@@ -9,36 +9,36 @@
class Download(BrowserView):
"""Download a file, via ../context/@@download/fieldname/filename
-
+
`fieldname` is the name of an attribute on the context that contains
the file. `filename` is the filename that the browser will be told to
give the file. If not given, it will be looked up from the field.
-
+
The attribute under `fieldname` should contain a named (blob) file/image
instance from this package.
-
+
If no `fieldname` is supplied, then a default field is looked up through
adaption to `plone.rfc822.interfaces.IPrimaryFieldInfo`.
"""
-
+
implements(IPublishTraverse)
-
+
def __init__(self, context, request):
super(Download, self).__init__(context, request)
self.fieldname = None
self.filename = None
-
+
def publishTraverse(self, request, name):
-
+
if self.fieldname is None: # ../@@download/fieldname
self.fieldname = name
elif self.filename is None: # ../@@download/fieldname/filename
self.filename = name
else:
raise NotFound(self, name, request)
-
+
return self
-
+
def __call__(self):
file = self._getFile()
self.set_headers(file)
@@ -60,15 +60,15 @@ def _getFile(self):
else:
context = getattr(self.context, 'aq_explicit', self.context)
file = guarded_getattr(context, self.fieldname, None)
-
+
if file is None:
raise NotFound(self, self.fieldname, self.request)
-
+
return file
-
+
class DisplayFile(Download):
"""Display a file, via ../context/@@display-file/fieldname/filename
-
+
Same as Download, however in this case we don't set the filename so the
browser can decide to display the file instead.
"""
diff --git a/plone/namedfile/configure.zcml b/plone/namedfile/configure.zcml
index ca1f816..c31ea88 100644
--- a/plone/namedfile/configure.zcml
+++ b/plone/namedfile/configure.zcml
@@ -10,14 +10,14 @@
class=".browser.Download"
permission="zope2.View"
/>
-
+
<browser:page
name="display-file"
for="*"
class=".browser.DisplayFile"
permission="zope2.View"
/>
-
+
<include file="z3c-blobfile.zcml" />
<include zcml:condition="installed plone.supermodel" file="handler.zcml" />
<include zcml:condition="installed plone.rfc822" file="marshaler.zcml" />
diff --git a/plone/namedfile/handler.py b/plone/namedfile/handler.py
index 4e58c59..51d3bb9 100644
--- a/plone/namedfile/handler.py
+++ b/plone/namedfile/handler.py
@@ -3,18 +3,18 @@
HAVE_SUPERMODEL = True
except ImportError:
HAVE_SUPERMODEL = False
-
+
if HAVE_SUPERMODEL:
-
+
from plone.namedfile import field
-
+
class FileFieldHandler(ObjectHandler):
-
+
filteredAttributes = ObjectHandler.filteredAttributes.copy()
filteredAttributes.update({'default': 'rw', 'missing_value': 'rw', 'schema': 'rw'})
-
+
NamedFileHandler = FileFieldHandler(field.NamedFile)
NamedImageHandler = FileFieldHandler(field.NamedImage)
-
+
NamedBlobFileHandler = FileFieldHandler(field.NamedBlobFile)
NamedBlobImageHandler = FileFieldHandler(field.NamedBlobImage)
diff --git a/plone/namedfile/handler.txt b/plone/namedfile/handler.txt
index b2330cd..7beae38 100644
--- a/plone/namedfile/handler.txt
+++ b/plone/namedfile/handler.txt
@@ -10,12 +10,12 @@ First, we wire up the handlers
... <configure
... xmlns="http://namespaces.zope.org/zope"
... i18n_domain="plone.namedfile">
- ...
+ ...
... <include package="zope.component" file="meta.zcml" />
... <include package="zope.security" file="meta.zcml" />
- ...
+ ...
... <include package="plone.namedfile" file="handler.zcml" />
- ...
+ ...
... </configure>
... """
@@ -38,7 +38,7 @@ unsupported.
Named file
-----------
- >>> field = NamedFile(__name__="dummy", title=u"Test",
+ >>> field = NamedFile(__name__="dummy", title=u"Test",
... description=u"Test desc", required=False, readonly=True)
>>> fieldType = IFieldNameExtractor(field)()
>>> handler = getUtility(IFieldExportImportHandler, name=fieldType)
@@ -60,7 +60,7 @@ Named file
... <title>Test</title>
... </field>
... """)
-
+
>>> reciprocal = handler.read(element)
>>> reciprocal.__class__
<class 'plone.namedfile.field.NamedFile'>
@@ -78,7 +78,7 @@ Named file
Named image
-----------
- >>> field = NamedImage(__name__="dummy", title=u"Test",
+ >>> field = NamedImage(__name__="dummy", title=u"Test",
... description=u"Test desc", required=False, readonly=True)
>>> fieldType = IFieldNameExtractor(field)()
>>> handler = getUtility(IFieldExportImportHandler, name=fieldType)
@@ -100,7 +100,7 @@ Named image
... <title>Test</title>
... </field>
... """)
-
+
>>> reciprocal = handler.read(element)
>>> reciprocal.__class__
<class 'plone.namedfile.field.NamedImage'>
@@ -118,7 +118,7 @@ Named image
Named blob file
---------------
- >>> field = NamedBlobFile(__name__="dummy", title=u"Test",
+ >>> field = NamedBlobFile(__name__="dummy", title=u"Test",
... description=u"Test desc", required=False, readonly=True)
>>> fieldType = IFieldNameExtractor(field)()
>>> handler = getUtility(IFieldExportImportHandler, name=fieldType)
@@ -140,7 +140,7 @@ Named blob file
... <title>Test</title>
... </field>
... """)
-
+
>>> reciprocal = handler.read(element)
>>> reciprocal.__class__
<class 'plone.namedfile.field.NamedBlobFile'>
@@ -158,7 +158,7 @@ Named blob file
Named blob image
----------------
- >>> field = NamedBlobImage(__name__="dummy", title=u"Test",
+ >>> field = NamedBlobImage(__name__="dummy", title=u"Test",
... description=u"Test desc", required=False, readonly=True)
>>> fieldType = IFieldNameExtractor(field)()
>>> handler = getUtility(IFieldExportImportHandler, name=fieldType)
@@ -180,7 +180,7 @@ Named blob image
... <title>Test</title>
... </field>
... """)
-
+
>>> reciprocal = handler.read(element)
>>> reciprocal.__class__
<class 'plone.namedfile.field.NamedBlobImage'>
diff --git a/plone/namedfile/handler.zcml b/plone/namedfile/handler.zcml
index 8a41015..fa52c3f 100644
--- a/plone/namedfile/handler.zcml
+++ b/plone/namedfile/handler.zcml
@@ -15,7 +15,7 @@
component=".handler.NamedImageHandler"
name="plone.namedfile.field.NamedImage"
/>
-
+
<utility
component=".handler.NamedBlobFileHandler"
name="plone.namedfile.field.NamedBlobFile"
diff --git a/plone/namedfile/interfaces.py b/plone/namedfile/interfaces.py
index e99ed91..ed4517c 100644
--- a/plone/namedfile/interfaces.py
+++ b/plone/namedfile/interfaces.py
@@ -52,7 +52,7 @@ class IAvailableSizes(Interface):
class INamed(Interface):
"""An item with a filename
"""
-
+
filename = schema.TextLine(title=u"Filename", required=False, default=None)
class INamedFile(INamed, IFile):
@@ -105,7 +105,7 @@ class INamedBlobFile(INamedFile, IBlobby):
class INamedBlobImage(INamedImage, IBlobby):
"""A BLOB image with a filename
"""
-
+
# Fields
class INamedBlobFileField(INamedFileField):
diff --git a/plone/namedfile/marshaler.py b/plone/namedfile/marshaler.py
index 645acd9..d2fd1a7 100644
--- a/plone/namedfile/marshaler.py
+++ b/plone/namedfile/marshaler.py
@@ -13,17 +13,17 @@
from plone.namedfile.interfaces import INamedFileField
from plone.namedfile.interfaces import INamedImageField
-
+
from plone.namedfile import NamedFile, NamedImage
-
+
class BaseNamedFileFieldMarshaler(BaseFieldMarshaler):
"""Base marshaler for plone.namedfile values. Actual adapters are
registered as subclasses.
"""
-
+
ascii = False
factory = None
-
+
def encode(self, value, charset='utf-8', primary=False):
# we only support encoding a file value in the body of a message,
# never in a header
@@ -32,7 +32,7 @@ def encode(self, value, charset='utf-8', primary=False):
if value is None:
return None
return value.data
-
+
def decode(self, value, message=None, charset='utf-8', contentType=None, primary=False):
filename = None
if primary and message is not None:
@@ -44,10 +44,10 @@ def getContentType(self):
if value is None:
return None
return value.contentType
-
+
def getCharset(self, default='utf-8'):
return None
-
+
def postProcessMessage(self, message):
"""Encode message as base64 and set content disposition
"""
@@ -61,38 +61,38 @@ def postProcessMessage(self, message):
header='Content-Disposition',
charset='utf-8'
)
-
+
encode_base64(message)
-
+
class NamedFileFieldMarshaler(BaseNamedFileFieldMarshaler):
"""Marshaler for an INamedFile field
"""
-
+
adapts(Interface, INamedFileField)
factory = NamedFile
class NamedImageFieldMarshaler(BaseNamedFileFieldMarshaler):
"""Marshaler for an INamedImage field
"""
-
+
adapts(Interface, INamedImageField)
factory = NamedImage
from plone.namedfile.interfaces import INamedBlobFileField
from plone.namedfile.interfaces import INamedBlobImageField
-
+
from plone.namedfile import NamedBlobFile, NamedBlobImage
-
+
class NamedBlobFileFieldMarshaler(BaseNamedFileFieldMarshaler):
"""Marshaler for an INamedBlobFile field
"""
-
+
adapts(Interface, INamedBlobFileField)
factory = NamedBlobFile
class NamedBlobImageFieldMarshaler(BaseNamedFileFieldMarshaler):
"""Marshaler for an INamedBlobImage field
"""
-
+
adapts(Interface, INamedBlobImageField)
factory = NamedBlobImage
diff --git a/plone/namedfile/marshaler.txt b/plone/namedfile/marshaler.txt
index fb153ba..5ae0020 100644
--- a/plone/namedfile/marshaler.txt
+++ b/plone/namedfile/marshaler.txt
@@ -10,14 +10,14 @@ To test this, we must first load some configuration:
... <configure
... xmlns="http://namespaces.zope.org/zope"
... i18n_domain="plone.namedfile.tests">
- ...
+ ...
... <include package="zope.component" file="meta.zcml" />
... <include package="zope.security" file="meta.zcml" />
- ...
+ ...
... <include package="plone.rfc822" />
- ...
+ ...
... <include package="plone.namedfile" file="marshaler.zcml" />
- ...
+ ...
... </configure>
... """
@@ -83,7 +83,7 @@ binary data into a UTF-8 string in a header.
Traceback (most recent call last):
...
ValueError: File fields can only be marshaled as primary fields
-
+
>>> marshaler.getContentType()
'text/plain'
>>> marshaler.ascii
@@ -94,7 +94,7 @@ binary data into a UTF-8 string in a header.
Traceback (most recent call last):
...
ValueError: File fields can only be marshaled as primary fields
-
+
>>> marshaler.getContentType()
'image/gif'
>>> marshaler.ascii
@@ -105,7 +105,7 @@ Let's try it with primary fields:
>>> marshaler = getMultiAdapter((t, ITestContent['_file']), IFieldMarshaler)
>>> marshaler.marshal(primary=True)
'dummy test data'
-
+
>>> marshaler.getContentType()
'text/plain'
>>> marshaler.getCharset('utf-8') is None
@@ -140,7 +140,7 @@ refuses to encode non-primary fields.
>>> from zope.interface import alsoProvides
>>> alsoProvides(ITestContent['_file'], IPrimaryField)
-
+
>>> message = constructMessageFromSchema(t, ITestContent)
>>> messageBody = renderMessage(message)
>>> print messageBody
diff --git a/plone/namedfile/scaling.zcml b/plone/namedfile/scaling.zcml
index 71e760f..a2ec18d 100644
--- a/plone/namedfile/scaling.zcml
+++ b/plone/namedfile/scaling.zcml
@@ -2,9 +2,9 @@
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
xmlns:zcml="http://namespaces.zope.org/zcml">
-
+
<include package="zope.annotation"/>
-
+
<browser:page
name="images"
for=".interfaces.IImageScaleTraversable"
diff --git a/plone/namedfile/storages.py b/plone/namedfile/storages.py
index 0f4c274..75cf4c7 100644
--- a/plone/namedfile/storages.py
+++ b/plone/namedfile/storages.py
@@ -26,7 +26,7 @@
class StringStorable(object):
implements(IStorage)
-
+
def store(self, data, blob):
if not isinstance(data, str):
raise NotStorable("Could not store data (not of 'str' type).")
@@ -38,7 +38,7 @@ def store(self, data, blob):
class UnicodeStorable(StringStorable):
implements(IStorage)
-
+
def store(self, data, blob):
if not isinstance(data, unicode):
raise NotStorable("Could not store data (not of 'unicode' "
@@ -50,7 +50,7 @@ def store(self, data, blob):
class FileChunkStorable(object):
implements(IStorage)
-
+
def store(self, data, blob):
if not isinstance(data, FileChunk):
raise NotStorable("Could not store data (not a of 'FileChunk' "
@@ -66,7 +66,7 @@ def store(self, data, blob):
class FileDescriptorStorable(object):
implements(IStorage)
-
+
def store(self, data, blob):
if not isinstance(data, file):
raise NotStorable("Could not store data (not of 'file').")
@@ -79,7 +79,7 @@ def store(self, data, blob):
class FileUploadStorable(object):
implements(IStorage)
-
+
def store(self, data, blob):
if not isinstance(data, FileUpload):
raise NotStorable("Could not store data (not of 'FileUpload').")
diff --git a/plone/namedfile/tests/test_blobfile.py b/plone/namedfile/tests/test_blobfile.py
index 7170e8f..420a06a 100644
--- a/plone/namedfile/tests/test_blobfile.py
+++ b/plone/namedfile/tests/test_blobfile.py
@@ -74,7 +74,7 @@ def testInterface(self):
self.failUnless(INamedBlobFile.implementedBy(NamedBlobImage))
self.failUnless(INamedBlobImage.implementedBy(NamedBlobImage))
self.failUnless(verifyClass(INamedBlobFile, NamedBlobImage))
-
+
def testDataMutatorWithLargeHeader(self):
from plone.namedfile.file import IMAGE_INFO_BYTES
bogus_header_length = struct.pack('>H', IMAGE_INFO_BYTES * 2)
@@ -98,4 +98,3 @@ def testCopyBlobs(self):
image_copy = copy(image)
self.assertEqual(image_copy.data, image.data)
-
\ No newline at end of file
diff --git a/plone/namedfile/tests/test_doctests.py b/plone/namedfile/tests/test_doctests.py
index b4ab21d..cfdc67e 100644
--- a/plone/namedfile/tests/test_doctests.py
+++ b/plone/namedfile/tests/test_doctests.py
@@ -9,19 +9,19 @@ def test_suite():
doctest.DocFileSuite(
'usage.txt', package='plone.namedfile',
setUp=setUp, tearDown=tearDown),
-
+
doctest.DocFileSuite(
'handler.txt', package='plone.namedfile',
setUp=setUp, tearDown=tearDown),
-
+
doctest.DocFileSuite(
'marshaler.txt', package='plone.namedfile',
setUp=setUp, tearDown=tearDown),
-
+
doctest.DocFileSuite(
'utils.txt', package='plone.namedfile',
setUp=setUp, tearDown=tearDown),
-
+
doctest.DocTestSuite('plone.namedfile.file'),
])
diff --git a/plone/namedfile/tests/testing.zcml b/plone/namedfile/tests/testing.zcml
index c6d6f77..f33711b 100644
--- a/plone/namedfile/tests/testing.zcml
+++ b/plone/namedfile/tests/testing.zcml
@@ -1,14 +1,14 @@
<configure
xmlns="http://namespaces.zope.org/zope"
i18n_domain="plone.namedfile.tests">
-
+
<include package="zope.security" file="meta.zcml" />
<include package="zope.component" file="meta.zcml" />
<include package="zope.browserpage" file="meta.zcml" />
<include package="zope.traversing" file="configure.zcml" />
-
+
<permission id="zope2.View" title="View" />
-
+
<include package="plone.namedfile" />
-
+
</configure>
\ No newline at end of file
diff --git a/plone/namedfile/usage.txt b/plone/namedfile/usage.txt
index c37181d..68e3e3a 100644
--- a/plone/namedfile/usage.txt
+++ b/plone/namedfile/usage.txt
@@ -12,9 +12,9 @@ We must first load the package's ZCML.
... <configure
... xmlns="http://namespaces.zope.org/zope"
... i18n_domain="plone.namedfile.tests">
- ...
+ ...
... <include package="plone.namedfile" />
- ...
+ ...
... </configure>
... """
@@ -37,7 +37,7 @@ test the BLOB versions of the fields if z3c.blobfile is installed.
... blob = field.NamedBlobFile(title=u"Named blob file")
... blobimage = field.NamedBlobImage(title=u"Named blob image file")
-These store data with the following types.
+These store data with the following types.
>>> from zope.interface import implements
>>> from plone import namedfile
@@ -73,7 +73,7 @@ The FileContainer class creates empty objects to start with.
''
>>> container.image.filename is None
True
-
+
>>> container.blob.data
''
>>> container.blob.contentType
@@ -86,7 +86,7 @@ The FileContainer class creates empty objects to start with.
''
>>> container.blobimage.filename is None
True
-
+
Let's now set some actual data in these files. Notice how the constructor
will attempt to guess the filename from the file extension.
@@ -105,7 +105,7 @@ will attempt to guess the filename from the file extension.
'text/plain'
>>> container.blob.filename
u'test.txt'
-
+
Let's also try to read a GIF, courtesy of the zope.app.file tests:
>>> zptlogo = (
@@ -172,8 +172,8 @@ The filename must be set to a unicode string, not a bytestring:
Download view
-------------
-This package also comes with a view that can be used to download files. This
-will set Content-Disposition to ensure the browser downloads the file rather
+This package also comes with a view that can be used to download files. This
+will set Content-Disposition to ensure the browser downloads the file rather
than displaying it. To use it, link to ../context-object/@@download/fieldname,
where `fieldname` is the name of the attribute on the context-object where the
named file is stored.
@@ -212,7 +212,7 @@ We will test this with a dummy request, faking traversal.
>>> download = Download(container, request).publishTraverse(request, 'image')
>>> download() == zptlogo
True
-
+
>>> request.response.getHeader('Content-Length')
'341'
>>> request.response.getHeader('Content-Type')
@@ -238,7 +238,7 @@ Display-file view
-----------------
This package also comes with a view that can be used to display files in the
-browser. To use it, link to ../context-object/@@display-file/fieldname, where
+browser. To use it, link to ../context-object/@@display-file/fieldname, where
`fieldname` is the name of the attribute on the context-object where the named
file is stored.
@@ -274,7 +274,7 @@ We will test this with a dummy request, faking traversal.
>>> display_file = DisplayFile(container, request).publishTraverse(request, 'image')
>>> display_file() == zptlogo
True
-
+
>>> request.response.getHeader('Content-Length')
'341'
>>> request.response.getHeader('Content-Type')
-------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHANGES.log
Type: application/octet-stream
Size: 22777 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140825/abe3c5c9/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: application/octet-stream
Size: 91267 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140825/abe3c5c9/attachment-0003.obj>
More information about the Testbot
mailing list