Author Topic: getPageType Strange Error  (Read 466 times)

Derek

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
  • Scribus User
getPageType Strange Error
« on: May 25, 2018, 10:13:48 pm »
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:
Code: [Select]
intPageType = scribus.getPageType()but that is generating an error:
Quote
Traceback (most recent call last):
  File "<string>", line 8, in <module>
  File "/home/derek/Data_OF/Scribus/Scripts/Hello World.py", line 47, in <module>
    intPageType = scribus.getPageType()
TypeError: function takes exactly 1 argument (0 given)

Replacing the line with:
Code: [Select]
intPageType = 1clears 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.

Suggestions?

Added May 26:I'm using Ubuntu 1804LTS, happens in Scribus 1.4.7 and yesterday's Scribus-Trunk build.
« Last Edit: May 26, 2018, 09:05:26 am by Derek »

Nermander

  • Hero Member
  • *****
  • Posts: 1218
  • Karma: 15
Re: getPageType Strange Error
« Reply #1 on: May 26, 2018, 01:27:48 pm »
The error message says the function needs an argument, and the paranthesis is empty.

I think you need to use

Code: [Select]
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.


a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1585
  • Karma: 23
    • the graphics lab
Re: getPageType Strange Error
« Reply #2 on: May 26, 2018, 02:35:46 pm »
... i guess that the page identity is the page number... starting from 0 or 1...

 

palmate