def _addRecentTile(layer, coord, format, body, age=300):
 key = (layer, coord, format)
 due = (time() + age)
 _recent_tiles['hash'][key] = (body, due)
 _recent_tiles['list'].append((key, due))
 logging.debug('TileStache.Core._addRecentTile() added tile to recent tiles: %s', key)
 cutoff = 0
 for (i, (key, due_by)) in enumerate(_recent_tiles['list']):
  if (time() < due_by):
   cutoff = i
   break
  logging.debug('TileStache.Core._addRecentTile() removed tile from recent tiles: %s', key)
  try:
   del _recent_tiles['hash'][key]
  except KeyError:
   pass
 del _recent_tiles['list'][:cutoff]

def _addRecentTile ( layer , coord , format , body , age = 300 ) : key = ( layer , coord , format ) due = ( time ( ) + age ) _recent_tiles [ 'hash' ] [ key ] = ( body , due ) _recent_tiles [ 'list' ] . append ( ( key , due ) ) logging . debug ( 'TileStache.Core._addRecentTile() added tile to recent tiles: %s' , key ) cutoff = 0 for ( i , ( key , due_by ) ) in enumerate ( _recent_tiles [ 'list' ] ) : if ( time ( ) < due_by ) : cutoff = i break logging . debug ( 'TileStache.Core._addRecentTile() removed tile from recent tiles: %s' , key ) try : del _recent_tiles [ 'hash' ] [ key ] except KeyError : pass del _recent_tiles [ 'list' ] [ : cutoff ]
add the body of a tile to _recent_tiles with a timeout .