getPageType Strange Error

Previous topic - Next topic


I'm faffing about with what should be a simple script. I'm creating a page, getting the margins, then trying to get the page type (0 = Left, 1 = Middle, 2 = Right) to create a text frame the correct position and size.

The code I'm using to try to get the page type is:
intPageType = scribus.getPageType()
but that is generating an error:
QuoteTraceback (most recent call last):
  File "<string>", line 8, in <module>
  File "/home/derek/Data_OF/Scribus/Scripts/Hello", line 47, in <module>
    intPageType = scribus.getPageType()
TypeError: function takes exactly 1 argument (0 given)

Replacing the line with:
intPageType = 1
clears the error and the rest of the script (so far) works fine.

Either I'm doing something really silly, or getPageType doesn't work as documented. I haven't been able to find an example of it being used anywhere so far.


Added May 26:I'm using Ubuntu 1804LTS, happens in Scribus 1.4.7 and yesterday's Scribus-Trunk build.


The error message says the function needs an argument, and the paranthesis is empty.

I think you need to use

scribus.getPageType(<page identity>)

I have no idea what <page identity> shall be, but of course you will have to let the function know for which page you are requesting the Page Type.


... i guess that the page identity is the page number... starting from 0 or 1...