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

Method checkStepNum

SLiCAP/SLiCAPinstruction.py:1019–1038  ·  view source on GitHub ↗

Checks if the number of steps is defined properly. Called by :**instruction.checkStep()** and by **instruction.setStepNum( )**. Also called by and by **instruction.setStepNum( )**.

(self)

Source from the content-addressed store, hash-verified

1017 return
1018
1019 def checkStepNum(self):
1020 """
1021 Checks if the number of steps is defined properly.
1022
1023 Called by :**instruction.checkStep()** and by **instruction.setStepNum(<stepNum>)**.
1024
1025 Also called by and by **instruction.setStepNum(<stepNum>)**.
1026 """
1027 if self.stepNum == None:
1028 self.errors += 1
1029 print("Error: missing stepNum value.")
1030 else:
1031 if type(self.stepNum) == int:
1032 if self.stepNum <= 0:
1033 self.errors += 1
1034 print("Error: step number must be a positive nonzero integer.")
1035 else:
1036 self.errors += 1
1037 print("Error: step number type must be 'int'.")
1038 return
1039
1040 def setStepList(self, stepList):
1041 """

Callers 2

setStepNumMethod · 0.95
checkStepMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected