[scribus] Giving a list as argument
jluc at no-log.org
Sat Feb 8 19:10:08 UTC 2014
Le 08/02/2014 17:30, Stephane Santon a écrit :
> def setHeightsToFirst( aObjs, aStartIndex, aCount):
> But my script is stopping with no error message on
> self.setHeightsToFirst( laoImages, 0, 3)
> In fact, the problem is giving more than 1 parameter.
> It works with
> self.setHeightsToFirst( laoImages)
> So, how to give more than 1 parameter to my method ??
Salut Stéphane, et bienvenue dans le monde de Scribus,
Several standard scribus scripts use such methods.
For example ColorChart.py (215) defines
def drawColor(colorname, h, v, width, height): #h horizontal position, v vertical position
that is later called so :
drawColor(color, h, v, colorFieldWidth, COLOR_FIELD_HEIGHT)
There are several other examples you can study.
My python skills are only based on trial and errors... so i cant tell for sure,
but if i were you i would try now to delete useless spaces before first arg,
since it looks like python is very touchy about spaces
More information about the scribus