Bug with GetCustomFunctionBlockTypes without exclusion POU fixed
authorlbessard
Mon, 01 Sep 2008 16:29:50 +0200 (2008-09-01)
changeset 246 9cf9694e8d66
parent 245 fdd05081c966
child 247 4a47ccafbef7
Bug with GetCustomFunctionBlockTypes without exclusion POU fixed
plcopen/plcopen.py
--- a/plcopen/plcopen.py	Sun Aug 31 18:41:07 2008 +0200
+++ b/plcopen/plcopen.py	Mon Sep 01 16:29:50 2008 +0200
@@ -508,12 +508,14 @@
 
     # Return Function Block types checking for recursion
     def GetCustomFunctionBlockTypes(self, exclude = ""):
-        pou = self.getpou(exclude)
-        type = pou.getpouType()
+        type = None
+        if exclude != "":
+            pou = self.getpou(exclude)
+            type = pou.getpouType()
         customblocktypes = []
         for customblocktype in self.CustomBlockTypes:
             if customblocktype["name"] != exclude and not self.ElementIsUsedBy(exclude, customblocktype["name"]) and not (type == "function" and customblocktype["type"] != "function"):
-                customblocktypes.appendcustom(customblocktype["name"])
+                customblocktypes.append(customblocktype["name"])
         return customblocktypes
     setattr(cls, "GetCustomFunctionBlockTypes", GetCustomFunctionBlockTypes)