Skip to content

Commit 9a777cc

Browse files
Bernhard ReiterBernhard Reiter
authored andcommitted
issue2550678: Allow pagesize=-1 which returns all results.
Suggested and implemented by John Kristensen. Tested by Satchidanand Haridas.
1 parent f14b38b commit 9a777cc

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ Entries without name were done by Richard Jones.
66
2011-XX-XX 1.4.20 (r4XXX)
77

88
Features:
9+
10+
- issue2550678: Allow pagesize=-1 which returns all results.
11+
Suggested and implemented by John Kristensen.
12+
Tested by Satchidanand Haridas. (Bernhard)
13+
914
Fixed:
1015

1116
- issue2550715: IndexError when requesting non-existing file via http.

roundup/cgi/ZTUtils/Batch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def __init__(self, sequence, size, start=0, end=0,
5252
"orphan" elements, it is combined with the current batch.
5353
"overlap" is the number of elements shared by adjacent
5454
batches. If "size" is not specified, it is computed from
55-
"start" and "end". Failing that, it is 7.
55+
"start" and "end". If "size" is 0, it is the length of
56+
the sequence. Failing that, it is 7.
5657
5758
Attributes: Note that the "start" attribute, unlike the
5859
argument, is a 1-based index (I know, lame). "first" is the
@@ -92,7 +93,9 @@ def __len__(self):
9293

9394
def opt(start,end,size,orphan,sequence):
9495
if size < 1:
95-
if start > 0 and end > 0 and end >= start:
96+
if size == 0:
97+
size=len(sequence)
98+
elif start > 0 and end > 0 and end >= start:
9699
size=end+1-start
97100
else: size=7
98101

0 commit comments

Comments
 (0)