[Scribus] Old Python Script Crashing
Gregory Pittman
gpittman
Wed Dec 5 17:50:39 CET 2007
Henry Hartley wrote:
> A few years ago (2004, to be precise) I wrote, with some advice from
> this list, a script that generated a calendar in Scribus. As the year
> draws to a close, I was thinking I might create a calendar for next year
> so I pulled out the script and tried to run it in a more recent Scribus
> but it won't run.
>
> I have Scribus 1.3.4 on Windows XP and Python 2.5. I found and fixed a
> number of problems with the script. I have in the code, I bunch of
> places where objects, either Image or Text, are created and then
> appended to an Objects collection. Please excuse me if I use the wrong
> terms but I don't really know Python -- Perl and PHP are more my thing.
> Anyway, take these four lines of code:
>
> ob = createImage(Xmgn, Ymgn, dayw*7, ImgHt, "Image" + str(Mn))
> Objects.append(ob)
> ob = createText(Xmgn, 2*Ymgn+ImgHt, dayw*7, TextHt, "Text" + str(Mn))
> Objects.append(ob)
>
> The third line, where I try to create the text object causes an error
> that identifies that line and says:
>
> NameExistsError: An object with the requested name already exists.
>
If you look at the naming of frames you will see that they progress this
way:
Image1, Text2, Text3, Image4....
so the last digit(s) should be unique.
Try incrementing or altering "Mn" or use a naming scheme with keys, or
....(your choice).
Greg
More information about the scribus
mailing list