comparison mercurial/templater.py @ 3654:734e337cb816

further simplify stringify
author Matt Mackall <mpm@selenic.com>
date Wed, 15 Nov 2006 15:51:58 -0600
parents b4ad640a3bcf
children abaee83ce0a6 0dd07dd63db3
comparison
equal deleted inserted replaced
3653:069f3acdad6c 3654:734e337cb816
154 return fmt(t, n) 154 return fmt(t, n)
155 155
156 def stringify(thing): 156 def stringify(thing):
157 '''turn nested template iterator into string.''' 157 '''turn nested template iterator into string.'''
158 if hasattr(thing, '__iter__'): 158 if hasattr(thing, '__iter__'):
159 return "".join([stringify(t) for t in thing]) 159 return "".join([stringify(t) for t in thing if t is not None])
160 if thing is None: return ""
161 return str(thing) 160 return str(thing)
162 161
163 para_re = None 162 para_re = None
164 space_re = None 163 space_re = None
165 164