[scribus] setLineSpacingMode()
Gregory Pittman
gregp_ky at yahoo.com
Fri Dec 3 20:27:53 CET 2010
On 12/03/2010 12:30 PM, Henry Hartley wrote:
> I'm working on a scribus script and I'm getting an error message when I try to set the line spacing mode for a text frame. Here's a short script that exhibits the error for me (1.3.6, but I'll be upgrading to 1.3.9 soon, if that will make a difference).
>
> #!/usr/bin/env python
>
> import scribus
> import os
>
> # Create a new document (this is one line)
> if scribus.newDoc(scribus.PAPER_LETTER, (40, 40, 40, 40),scribus.PORTRAIT, 1, scribus.UNIT_POINTS, scribus.NOFACINGPAGES, scribus.FIRSTPAGERIGHT):
>
> # Create a text frame and put some text in it
> Lpic = scribus.createText(100, 100, 300, 40)
> scribus.setText("This is a test.", Lpic)
>
> # Here's where the error comes
> scribus.setLineSpacingMode(1, Lpic)
>
> When I Run that I get the following:
>
> Traceback (most recent call last):
> File "<string>", line 8, in<module>
> File "C:\temp\photographs\test.py", line 14, in<module>
> scribus.setLineSpacingMode(1, Lpic)
> AttributeError: 'module' object has no attribute 'setLineSpacingMode'
>
> setLineSpacingMode() is documented here: http://docs.scribus.net/index.php?lang=en&page=scripterapi-textframes#-setLineSpacingMode.
You should always rely on the docs with the version you are using.
Apparently, setLineSpacingMode is obsolete.
Options:
Set the desired mode as your default for text frames. I think that left
unspecified, this will be the mode for a script-created text frame.
Use a style with your desired mode, then apply that style with the script.
Greg
More information about the scribus
mailing list