MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / checkStepList

Method checkStepList

SLiCAP/SLiCAPinstruction.py:1069–1092  ·  view source on GitHub ↗

Checks if the list with step values is defined properly. Called by **instruction.checkStep()** and by **instruction.setStepList( )**.

(self)

Source from the content-addressed store, hash-verified

1067 return
1068
1069 def checkStepList(self):
1070 """
1071 Checks if the list with step values is defined properly.
1072
1073 Called by **instruction.checkStep()** and by **instruction.setStepList(<stepList>)**.
1074 """
1075 if self.stepList == None:
1076 self.errors += 1
1077 print("Error: missing stepList.")
1078 elif type(self.stepList) == list:
1079 if len(self.stepList) == 0:
1080 self.errors += 1
1081 print("Error: empty stepList.")
1082 for i in range(len(self.stepList)):
1083 value = _checkNumber(self.stepList[i])
1084 if value == None:
1085 self.errors += 1
1086 print("Error: cannot determine numeric value of stepList[{0}].".format(i))
1087 else:
1088 self.stepList[i] = value
1089 else:
1090 self.errors += 1
1091 print("Error: expected a list type for 'stepValues'.")
1092 return
1093
1094 def setStepArray(self, stepArray):
1095 """

Callers 2

setStepListMethod · 0.95
checkStepMethod · 0.95

Calls 2

_checkNumberFunction · 0.90
formatMethod · 0.80

Tested by

no test coverage detected