[Libreoffice] Extension-Repository: Need help to solve a Python error

Andreas Mantke maand at gmx.de
Tue Jul 12 11:50:12 PDT 2011


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 


More information about the LibreOffice mailing list