1 | from st2common.runners.base_action import Action |
||
2 | |||
3 | |||
4 | class IncreaseIndexAndCheckCondition(Action): |
||
5 | def run(self, index, pagesize, input): |
||
0 ignored issues
–
show
|
|||
6 | if pagesize and pagesize != '': |
||
7 | if len(input) < int(pagesize): |
||
8 | return (False, "Breaking out of the loop") |
||
9 | else: |
||
10 | pagesize = 0 |
||
11 | |||
12 | if not index or index == '': |
||
13 | index = 1 |
||
14 | |||
15 | return(True, int(index) + 1) |
||
16 |
It is generally discouraged to redefine built-ins as this makes code very hard to read.