Skip to content

Commit

Permalink
Added __len__ method of sequence_variables class for processing of le…
Browse files Browse the repository at this point in the history
…n inside cDocumentTemplate len function when they're pushed on the stack.
  • Loading branch information
mcdonc committed Jan 16, 2001
1 parent 1e126ab commit aa1683d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions DT_InSV.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
__doc__='''Sequence variables support
$Id: DT_InSV.py,v 1.17 2000/05/12 18:36:39 tseaver Exp $'''
__version__='$Revision: 1.17 $'[11:-2]
$Id: DT_InSV.py,v 1.18 2001/01/16 21:57:19 chrism Exp $'''
__version__='$Revision: 1.18 $'[11:-2]

from string import lower, rfind, split, join
from math import sqrt
Expand All @@ -113,6 +113,7 @@ def __init__(self,items=None,query_string='',start_name_re=None):
}


def __len__(self): return 1
def number(self,index): return index+1
def even(self,index): return index%2 == 0
def odd(self,index): return index%2
Expand Down Expand Up @@ -407,6 +408,8 @@ def __getitem__(self,key,
raise KeyError, key




def sub(s1, s2, src):
return join(split(src, s1), s2)

Expand Down

0 comments on commit aa1683d

Please sign in to comment.