Commit 297e42ce authored by Jim Fulton's avatar Jim Fulton

Fixed stupid bug in batch processing that became effective in Python 1.5.2.

parent ad7f1e56
...@@ -381,8 +381,8 @@ ...@@ -381,8 +381,8 @@
''' #' ''' #'
__rcs_id__='$Id: DT_In.py,v 1.36 1999/06/14 14:04:33 brian Exp $' __rcs_id__='$Id: DT_In.py,v 1.37 1999/06/21 21:29:42 jim Exp $'
__version__='$Revision: 1.36 $'[11:-2] __version__='$Revision: 1.37 $'[11:-2]
from DT_Util import ParseError, parse_params, name_param, str from DT_Util import ParseError, parse_params, name_param, str
from DT_Util import render_blocks, InstanceDict, ValidationError from DT_Util import render_blocks, InstanceDict, ValidationError
...@@ -531,7 +531,7 @@ class InClass: ...@@ -531,7 +531,7 @@ class InClass:
try: try:
if previous: if previous:
if first > 0: if first > 0:
pstart,pend,psize=opt(None,first+overlap, pstart,pend,psize=opt(0,first+overlap,
sz,orphan,sequence) sz,orphan,sequence)
kw['previous-sequence']=1 kw['previous-sequence']=1
kw['previous-sequence-start-index']=pstart-1 kw['previous-sequence-start-index']=pstart-1
...@@ -547,7 +547,7 @@ class InClass: ...@@ -547,7 +547,7 @@ class InClass:
# there are more items, without actually # there are more items, without actually
# computing a length: # computing a length:
sequence[end] sequence[end]
pstart,pend,psize=opt(end+1-overlap,None, pstart,pend,psize=opt(end+1-overlap,0,
sz,orphan,sequence) sz,orphan,sequence)
kw['next-sequence']=1 kw['next-sequence']=1
kw['next-sequence-start-index']=pstart-1 kw['next-sequence-start-index']=pstart-1
...@@ -563,7 +563,7 @@ class InClass: ...@@ -563,7 +563,7 @@ class InClass:
validate=md.validate validate=md.validate
for index in range(first,end): for index in range(first,end):
if index==first and index > 0: if index==first and index > 0:
pstart,pend,psize=opt(None,index+overlap, pstart,pend,psize=opt(0,index+overlap,
sz,orphan,sequence) sz,orphan,sequence)
kw['previous-sequence']=1 kw['previous-sequence']=1
kw['previous-sequence-start-index']=pstart-1 kw['previous-sequence-start-index']=pstart-1
...@@ -577,7 +577,7 @@ class InClass: ...@@ -577,7 +577,7 @@ class InClass:
# test whether there are more items, # test whether there are more items,
# without actually computing a length: # without actually computing a length:
sequence[end] sequence[end]
pstart,pend,psize=opt(end+1-overlap,None, pstart,pend,psize=opt(end+1-overlap,0,
sz,orphan,sequence) sz,orphan,sequence)
kw['previous-sequence']=0 kw['previous-sequence']=0
kw['next-sequence']=1 kw['next-sequence']=1
......
...@@ -85,8 +85,8 @@ ...@@ -85,8 +85,8 @@
__doc__='''Sequence variables support __doc__='''Sequence variables support
$Id: DT_InSV.py,v 1.10 1999/03/10 00:15:07 klm Exp $''' $Id: DT_InSV.py,v 1.11 1999/06/21 21:29:53 jim Exp $'''
__version__='$Revision: 1.10 $'[11:-2] __version__='$Revision: 1.11 $'[11:-2]
from string import lower, rfind from string import lower, rfind
from math import sqrt from math import sqrt
...@@ -317,7 +317,7 @@ class sequence_variables: ...@@ -317,7 +317,7 @@ class sequence_variables:
except: AttributeError, 'next-batches' except: AttributeError, 'next-batches'
r=[] r=[]
while end < l: while end < l:
start,end,spam=opt(end+1-overlap,None,sz,orphan,sequence) start,end,spam=opt(end+1-overlap,0,sz,orphan,sequence)
v=sequence_variables(self.items, v=sequence_variables(self.items,
self.query_string,self.start_name_re) self.query_string,self.start_name_re)
d=v.data d=v.data
...@@ -344,7 +344,7 @@ class sequence_variables: ...@@ -344,7 +344,7 @@ class sequence_variables:
except: AttributeError, 'previous-batches' except: AttributeError, 'previous-batches'
r=[] r=[]
while start > 1: while start > 1:
start,end,spam=opt(None,start-1+overlap,sz,orphan,sequence) start,end,spam=opt(0,start-1+overlap,sz,orphan,sequence)
v=sequence_variables(self.items, v=sequence_variables(self.items,
self.query_string,self.start_name_re) self.query_string,self.start_name_re)
d=v.data d=v.data
...@@ -405,6 +405,7 @@ def opt(start,end,size,orphan,sequence): ...@@ -405,6 +405,7 @@ def opt(start,end,size,orphan,sequence):
if start > 0 and end > 0 and end >= start: if start > 0 and end > 0 and end >= start:
size=end+1-start size=end+1-start
else: size=7 else: size=7
if start > 0: if start > 0:
try: sequence[start-1] try: sequence[start-1]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment