# HG changeset patch # User etisserant # Date 1232349701 -3600 # Node ID 0ed2b61de43e3528590a1f88df5d2a9600121296 # Parent 2df3d31d8059f0e0d56a331d57b3d72b447446db Fixed bug structures.py crashing with non-connected blocks. diff -r 2df3d31d8059 -r 0ed2b61de43e plcopen/structures.py --- a/plcopen/structures.py Fri Jan 16 13:22:07 2009 +0100 +++ b/plcopen/structures.py Mon Jan 19 08:21:41 2009 +0100 @@ -34,8 +34,11 @@ "L" : ["LINT", "ULINT", "LREAL", "LWORD"]} # Helper for emulate join on element list -def JoinList(separator, list): - return reduce(lambda x, y: x + separator + y, list) +def JoinList(separator, mylist): + if len(mylist) > 0 : + return reduce(lambda x, y: x + separator + y, mylist) + else : + return mylist def generate_block(generator, block, body, link, order=False): body_type = body.getcontent()["name"]