[scribus] Python scripting issue with ImageWriter - "NoneType object is not callable" error

Andrea Marcon amarcon.work at gmail.com
Thu Mar 31 23:25:59 UTC 2016


Hello!
I'm a Python newbie and I'm trying to automatize a task within Scribus.
I'm producing a large number of labels - for boxes containing products -
that need to have the barcode of the product.

I've written a stand-alone python script that read the numerical code from
a csv and create a png image, then I wrote another script (run from in
within Scribus) that creates the layout of the labels and pastes the
previously created images.

I decided to include (i.e. copy-paste) the stand-alone script for barcode
creation into the Scribus-related one, and it's not working anymore!
I inserted the stand-alone code as a function, and I call it in the main()
part.

It seems that Python, when working from Scribus scripter, does not
recognise ImageWriter (from pyBarcode).
The error it returns is:


*var = barcode.get_barcode('Code128', '1234567891234', writer=
ImageWriter())*
*TypeError: 'NoneType' object is not callable*

I'm kinda sure the problem lays in the "imageWriter()" part, because when I
took it out the script worked fine, except that produced SVG images instead
of PNG (as it's supposed to), and that the method's options for modifying
the resulting SVG image (i.e. dimensions and font size) are not working!

Does anybody know what's happening or how to solve it?

Thank you very much for any hint!

Andrea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20160401/28bdb441/attachment.html>


More information about the scribus mailing list