comparison MoinMoin/formatter/__init__.py @ 1868:64507f46beb2

reduce usage of has_key()
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 10 Mar 2007 22:01:07 +0100
parents ebcebba1afb3
children 1405a38ae848
comparison
equal deleted inserted replaced
1867:8166b37db555 1868:64507f46beb2
156 In particular an 'alt' or 'title' argument should give a description 156 In particular an 'alt' or 'title' argument should give a description
157 of the image. 157 of the image.
158 """ 158 """
159 title = src 159 title = src
160 for titleattr in ('title', 'html__title', 'alt', 'html__alt'): 160 for titleattr in ('title', 'html__title', 'alt', 'html__alt'):
161 if kw.has_key(titleattr): 161 if titleattr in kw:
162 title = kw[titleattr] 162 title = kw[titleattr]
163 break 163 break
164 if title: 164 if title:
165 return '[Image:%s]' % title 165 return '[Image:%s]' % title
166 return '[Image]' 166 return '[Image]'