(loop_def, variables, cursor, connection)
| 57 | |
| 58 | |
| 59 | def execute_loop(loop_def, variables, cursor, connection): |
| 60 | loop_var_name = loop_def['as'] |
| 61 | loop_variables = variables.copy() |
| 62 | |
| 63 | if 'over' in loop_def: |
| 64 | iterable = loop_def['over'] |
| 65 | elif 'range' in loop_def: |
| 66 | start = loop_def['range']['start'] |
| 67 | end = loop_def['range']['end'] |
| 68 | iterable = range(start, end + 1) |
| 69 | else: |
| 70 | raise ValueError("Loop must have 'over' or 'range' defined.") |
| 71 | |
| 72 | for item in iterable: |
| 73 | loop_variables[loop_var_name] = item |
| 74 | execute_steps(loop_def['steps'], loop_variables, cursor, connection) |
| 75 | |
| 76 | |
| 77 | def execute_step(step, variables, cursor, connection): |
no test coverage detected
searching dependent graphs…