comparison rhodecode/lib/celerylib/tasks.py @ 3626:0a1417ef1a9c beta

celery tasks: use None as special value Use a more common pattern.
author Mads Kiilerich <madski@unity3d.com>
date Thu, 28 Mar 2013 01:10:45 +0100
parents cf665eb84d4c
children 3563bb7b4b82
comparison
equal deleted inserted replaced
3625:260a7a01b054 3626:0a1417ef1a9c
158 try: 158 try:
159 l = [timegetter(x) for x in 159 l = [timegetter(x) for x in
160 co_day_auth_aggr[akc(cs.author)]['data']] 160 co_day_auth_aggr[akc(cs.author)]['data']]
161 time_pos = l.index(k) 161 time_pos = l.index(k)
162 except ValueError: 162 except ValueError:
163 time_pos = False 163 time_pos = None
164 164
165 if time_pos >= 0 and time_pos is not False: 165 if time_pos >= 0 and time_pos is not None:
166 166
167 datadict = \ 167 datadict = \
168 co_day_auth_aggr[akc(cs.author)]['data'][time_pos] 168 co_day_auth_aggr[akc(cs.author)]['data'][time_pos]
169 169
170 datadict["commits"] += 1 170 datadict["commits"] += 1