[scribus] Error in script from Wiki

Gregory Pittman gpittman at iglou.com
Sat May 19 22:55:38 UTC 2018


On 05/19/2018 03:33 PM, Viktor Trojanovic wrote:
> On 19 May 2018 at 21:02, Gregory Pittman <gpittman at iglou.com> wrote:
> 
>> On 05/19/2018 02:36 PM, Juraj Fedel wrote:
>> […]
>>>
>>> All that said there is one error in script:
>>>
>>> <<<<<<<<
>>> if scribus.haveDoc():
>>>
>>> else:
>>>     scribus.messageBox('Usage Error', 'You need a Document open',
>> scribus.ICON_WARNING, scribus.BUTTON_OK)
>>>     sys.exit(2)
>>> ========
>>> if scribus.haveDoc():
>>>     pass
>>> else:
>>>     scribus.messageBox('Usage Error', 'You need a Document open',
>> scribus.ICON_WARNING, scribus.BUTTON_OK)
>>>     sys.exit(2)
>>>>>>>>>>>
>>>
>>> There is missing one line with single command in it:
>>>     pass
>>>
>>> add that line and script will run fine.
>>>
>>
>> Thanks Juraj,
>>
>> I fixed the wiki article.
>>
>> Greg
>>
>>
>>
> Thanks for the fix, the script runs without issues now.
> 

This was an interesting puzzle. Since I was the one who wrote the script
and the wiki article, I looked back at my files. In the version on my
computer, I had a line 'c = 0' after the 'if scribus.haveDoc():'
statement, so apparently I originally had some use for setting the c
variable, but then later realized I didn't need it, and deleted it
without rechecking the script.

Greg



More information about the scribus mailing list