--- a/plcopen/plcopen.py Wed Sep 14 23:05:04 2011 +0200
+++ b/plcopen/plcopen.py Wed Sep 14 23:06:05 2011 +0200
@@ -2355,6 +2355,7 @@
cls = PLCOpenClasses.get("value", None)
if cls:
def setvalue(self, value):
+ value = value.strip()
if value.startswith("[") and value.endswith("]"):
arrayValue = PLCOpenClasses["value_arrayValue"]()
self.content = {"name" : "arrayValue", "value" : arrayValue}
@@ -2408,8 +2409,11 @@
values = []
for element in self.value:
repetition = element.getrepetitionValue()
- if repetition is not None and repetition > 1:
- values.append("%s(%s)"%(repetition, element.getvalue()))
+ if repetition is not None and int(repetition) > 1:
+ value = element.getvalue()
+ if value is None:
+ value = ""
+ values.append("%s(%s)"%(repetition, value))
else:
values.append(element.getvalue())
return "[%s]"%", ".join(values)