Skip to content

Commit

Permalink
Added new meaning for else tag when next or previous are used.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fulton committed Mar 20, 1998
1 parent bd23d60 commit 4f33462
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions DT_In.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,23 @@
Missing values are either 'None' or the attribute 'Value'
of the module 'Missing', if present.
'else' continuation tag within in
An 'else' tag may be used as a continuation tag in the 'in' tag.
The source after the 'else' tag is inserted if:
- The sequence given to the 'in' tag is of zero length, or
- The 'previous' attribute was used and their are no
previous batches, or
- The 'next' attribute was used and their are no
next batches, or
''' #'

__rcs_id__='$Id: DT_In.py,v 1.21 1998/02/18 15:17:54 jim Exp $'
__rcs_id__='$Id: DT_In.py,v 1.22 1998/03/20 17:52:29 jim Exp $'

############################################################################
# Copyright
Expand Down Expand Up @@ -336,7 +350,7 @@
# (540) 371-6909
#
############################################################################
__version__='$Revision: 1.21 $'[11:-2]
__version__='$Revision: 1.22 $'[11:-2]

from DT_Util import *
from string import find, atoi, join
Expand Down Expand Up @@ -461,6 +475,8 @@ def render(self, md):
kw['previous-sequence-end-index']=pend-1
kw['previous-sequence-size']=pend+1-pstart
result=section(None,md)

elif self.elses: result=self.elses(None, md)
else: result=''
elif next:
try:
Expand All @@ -475,7 +491,9 @@ def render(self, md):
kw['next-sequence-end-index']=pend-1
kw['next-sequence-size']=pend+1-pstart
result=section(None,md)
except: result=''
except:
if self.elses: result=self.elses(None, md)
else: result=''
else:
result = []
for index in range(first,end):
Expand Down Expand Up @@ -856,6 +874,9 @@ def previous_batches(self):

############################################################################
# $Log: DT_In.py,v $
# Revision 1.22 1998/03/20 17:52:29 jim
# Added new meaning for else tag when next or previous are used.
#
# Revision 1.21 1998/02/18 15:17:54 jim
# Added sequence-step-start-index and sequence-step-end-index and
# their documentation.
Expand Down

0 comments on commit 4f33462

Please sign in to comment.