Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi Caolan, *,

Am Montag, 11. Juli 2011, 18:27:09 schrieb Caolán McNamara:
On Tue, 2011-07-05 at 21:14 +0200, Andreas Mantke wrote:
(...)
given that a contenttype is required, some total guesswork suggests...

-blob = BlobWrapper()
-if isinstance(value, basestring):
-# make StringIO from string, because StringIO may be adapted to
-#Blobabble
-value = StringIO(value)
-if value is not None:
-blobbable = IBlobbable(value)
-blobbable.feed(blob.getBlob())
-blob.setContentType(blobbable.mimetype())

might need to become

+if isinstance(value, basestring):
+# make StringIO from string, because StringIO may be adapted to
+#Blobabble
+value = StringIO(value)
+if value is not None:
+blobbable = IBlobbable(value)
+#move blob ctor down to where we know the mimetype
+blob = BlobWrapper(blobbable.mimetype())
+blobbable.feed(blob.getBlob())
+blob.setContentType(blobbable.mimetype()) #maybe drop this then

or something of that nature, you get my drift anyway. That the
super-class BlobWrapper may take an additional argument in your plone
over the version that the template that you based the above on works
with.

thanks, your patch proposal solved the issue for me. I commited the patch to the 
Plone community repository and it is now inside our extension-template-website. We 
can store binaries (extensions / templates) inside the file system now.

Regards,
Andreas
-- 
## Developer LibreOffice
## Freie Office-Suite für Linux, Mac, Windows
## http://LibreOffice.org
## Support the Document Foundation (http://documentfoundation.org)
## Meine Seite: http://www.amantke.de 

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.