I am a python n00b, and I cannot figure this out.

I got a script from forum that is supposed to "build" a set of calendar pages in Scribus.

It won't run on my Mac (Intel iMac, MacOS 10.5.8, Python 2.7, Scribus 1.3.8)

Here is an extract containing the offending code:

---------------------------------------------
def drawRulesGrid(pageSide):
        """Draws rules on the page"""
        lineSpace = (LINE_LAST_Y - LINE_FIRST_Y) / 30
        if pageSide == 'right':
                StartLines = (R_LINE_X + (C * LINE_X_OFFSET) for C in 
range(COLUMNS))
                BigLines = [0, 10, 20, 25, 30]
        elif pageSide == 'left':
                StartLines = (L_LINE_X + (C * LINE_X_OFFSET) for C in 
range(COLUMNS))
                BigLines = [0, 10, 20, 30]
        for j in StartLines:
                StartLineX, StartLineY = j, LINE_FIRST_Y
                for i in range(31):
Line = createLine(StartLineX, StartLineY, StartLineX+LINE_LENGHT, StartLineY)
                        if i in BigLines:
                                setLineWidth(BIG_LINE_WIDTH, Line)
                        else:
                                setLineWidth(THIN_LINE_WIDTH, Line)
                        StartLineY += lineSpace
---------------------------------------------

And the error:

---------------------------------------------
Traceback (most recent call last):
File "", line 8, in ?
File "SamAgenda.py", line 221
StartLines = (R_LINE_X + (C * LINE_X_OFFSET) for C in range(COLUMNS))
                                                  ^
SyntaxError: invalid syntax
---------------------------------------------

In case the spacing gets messed up, the caret is pointing at the "r" in "for"

The author claims this runs on python 2.6.5, Scribus 1.3.3.13svn, Ubuntu 10.04.

Any clues for this clueless one ?
Thanks.
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG

Reply via email to