Commit 54c6cb2a authored by Chris McDonough's avatar Chris McDonough

Added __len__ method of sequence_variables class for processing of len inside...

Added __len__ method of sequence_variables class for processing of len inside cDocumentTemplate len function when they're pushed on the stack.
parent 5026b760
......@@ -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
......@@ -113,6 +113,7 @@ class sequence_variables:
}
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
......@@ -407,6 +408,8 @@ class sequence_variables:
raise KeyError, key
def sub(s1, s2, src):
return join(split(src, s1), s2)
......
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