Issue 29: Invalid syntax errors on MacOS 10.5; seems to be an issue with the Python on the user's system not allowing conditional expressions which, reportedly, were a major new feature in Python 2.5 circa August 2006 and described in POP 308

git-svn-id: https://eggbotcode.googlecode.com/svn/trunk@151 72233254-1b6c-9e9c-5072-401df62706fb
pull/47/head
newman.daniel1 2010-10-18 19:23:54 +00:00
rodzic 584bda464d
commit af9cd1df81
1 zmienionych plików z 18 dodań i 2 usunięć

Wyświetl plik

@ -737,7 +737,15 @@ class EggBot( inkex.Effect ):
else:
pa = pl.split()
d = "".join( ["M " + pa[i] if i == 0 else " L " + pa[i] for i in range( 0, len( pa ) )] )
if not len( pa ):
pass
# Issue 29: pre 2.5.? versions of Python do not have
# "statement-1 if expression-1 else statement-2"
# which came out of PEP 308, Conditional Expressions
#d = "".join( ["M " + pa[i] if i == 0 else " L " + pa[i] for i in range( 0, len( pa ) )] )
d = "M " + pa[0]
for i in range( 1, len( pa ) ):
d += " L " + pa[i]
newpath = inkex.etree.Element( inkex.addNS( 'path', 'svg' ) )
newpath.set( 'd', d );
s = node.get( 'style' )
@ -780,7 +788,15 @@ class EggBot( inkex.Effect ):
else:
pa = pl.split()
d = "".join( ["M " + pa[i] if i == 0 else " L " + pa[i] for i in range( 0, len( pa ) )] )
if not len( pa ):
pass
# Issue 29: pre 2.5.? versions of Python do not have
# "statement-1 if expression-1 else statement-2"
# which came out of PEP 308, Conditional Expressions
#d = "".join( ["M " + pa[i] if i == 0 else " L " + pa[i] for i in range( 0, len( pa ) )] )
d = "M " + pa[0]
for i in range( 1, len( pa ) ):
d += " L " + pa[i]
d += " Z"
newpath = inkex.etree.Element( inkex.addNS( 'path', 'svg' ) )
newpath.set( 'd', d );