PLCControler.py
changeset 649 ea237e1431ec
parent 647 2d53c653d8d2
child 661 7891872e6fd7
equal deleted inserted replaced
648:95d165193770 649:ea237e1431ec
  1283         for category in BlockTypes + self.GetPluginBlockTypes():
  1283         for category in BlockTypes + self.GetPluginBlockTypes():
  1284             for blocktype in category["list"]:
  1284             for blocktype in category["list"]:
  1285                 if blocktype["name"] == type:
  1285                 if blocktype["name"] == type:
  1286                     if inputs is not None and inputs != "undefined":
  1286                     if inputs is not None and inputs != "undefined":
  1287                         block_inputs = tuple([var_type for name, var_type, modifier in blocktype["inputs"]])
  1287                         block_inputs = tuple([var_type for name, var_type, modifier in blocktype["inputs"]])
  1288                         if reduce(lambda x, y: x and y, map(lambda x: x[0] == "ANY" or self.IsOfType(*x), zip(inputs, block_inputs))):
  1288                         if reduce(lambda x, y: x and y, map(lambda x: x[0] == "ANY" or self.IsOfType(*x), zip(inputs, block_inputs)), True):
  1289                             return blocktype
  1289                             return blocktype
  1290                     else:
  1290                     else:
  1291                         if result_blocktype is not None:
  1291                         if result_blocktype is not None:
  1292                             if inputs == "undefined":
  1292                             if inputs == "undefined":
  1293                                 return None
  1293                                 return None