comparison dogdish/dispatcher.py @ 21:ce97a26e4c03 default tip

remove legacy code
author Jeff Hammel
date Mon, 12 Nov 2012 23:40:06 +0000
parents 71c36a7842d1
children
comparison
equal deleted inserted replaced
20:71c36a7842d1 21:ce97a26e4c03
184 184
185 def __call__(self, environ, start_response): 185 def __call__(self, environ, start_response):
186 """WSGI application""" 186 """WSGI application"""
187 187
188 request = Request(environ) 188 request = Request(environ)
189 new = self.scan() 189 self.scan()
190 for h in self.handlers: 190 for h in self.handlers:
191 if h.match(request): 191 if h.match(request):
192 handler = h(self, request) 192 handler = h(self, request)
193 res = handler() 193 res = handler()
194 break 194 break
203 returns True if new updates are found, False otherwise 203 returns True if new updates are found, False otherwise
204 """ 204 """
205 205
206 # check for new updates 206 # check for new updates
207 contents = self.update_class.updates(self.directory) 207 contents = self.update_class.updates(self.directory)
208 new = contents.difference(self.updates.keys())
209 if not new:
210 # directory contents unchanged from cached values
211 # return False
212 # XXX: we can't rely on caching this, since in the case of a bad update,
213 # an earlier update will be promoted via 'touch'.
214 pass
215
216 for update in contents: 208 for update in contents:
217 self.updates[update] = self.update_class(self.directory, update) 209 self.updates[update] = self.update_class(self.directory, update)
218 if self.current_update: 210 if self.current_update:
219 if self.updates[update].modifiedTime > self.current_update.modifiedTime: 211 if self.updates[update].modifiedTime > self.current_update.modifiedTime:
220 self.current_update = self.updates[update] 212 self.current_update = self.updates[update]