X-Git-Url: https://git.tokkee.org/?p=roundup.git;a=blobdiff_plain;f=roundup%2Fcgi%2FZTUtils%2FBatch.py;fp=roundup%2Fcgi%2FZTUtils%2FBatch.py;h=0ee9738342b2016269895cc0145ce9492ffc6557;hp=66dde6861ac3bd3a0606ce9d586bec39fa3ef1e1;hb=536ed06a50f397c6c98e3779a8d40eb433ed017c;hpb=840af79b7d2c41ed0dfd70b496b6b5f3ffefc510 diff --git a/roundup/cgi/ZTUtils/Batch.py b/roundup/cgi/ZTUtils/Batch.py index 66dde68..0ee9738 100644 --- a/roundup/cgi/ZTUtils/Batch.py +++ b/roundup/cgi/ZTUtils/Batch.py @@ -52,7 +52,8 @@ class Batch: "orphan" elements, it is combined with the current batch. "overlap" is the number of elements shared by adjacent batches. If "size" is not specified, it is computed from - "start" and "end". Failing that, it is 7. + "start" and "end". If "size" is 0, it is the length of + the sequence. Failing that, it is 7. Attributes: Note that the "start" attribute, unlike the argument, is a 1-based index (I know, lame). "first" is the @@ -92,7 +93,9 @@ class Batch: def opt(start,end,size,orphan,sequence): if size < 1: - if start > 0 and end > 0 and end >= start: + if size == 0: + size=len(sequence) + elif start > 0 and end > 0 and end >= start: size=end+1-start else: size=7