Beispiel #1
0
def add_geo_locations_to_place(place, georesolver):
    with block_signals():
        location = georesolver.lookup_place(place)
        if not location:
            location = as_location_not_found()

        place.update(location)
        return place
Beispiel #2
0
 def message_handler_callback(ch, method, properties, body):
     with block_signals():
         response = message_handler(body)
         ch.basic_publish(exchange='',
                          routing_key=properties.reply_to,
                          properties=pika.BasicProperties(
                              correlation_id=properties.correlation_id),
                          body=response)
         ch.basic_ack(delivery_tag=method.delivery_tag)
Beispiel #3
0
def dsb_import_departures_from_stations(stations):
    for station in stations:
        with block_signals():
            try:
                rmq_send.send_departures_to_storage(
                    station, import_departures_from_station(station['Uic']))
            except (urllib2.HTTPError, urllib2.URLError):
                print "Connection error when trying to retrieve departures from station: %s" % station

        # Lets not ddos DSB :-)
        sleep(2)
Beispiel #4
0
 def message_handler_callback(ch, method, properties, body):
     with block_signals():
         print "Received message on %r: " % (queue_name, )
         message_handler(body)
         ch.basic_ack(delivery_tag=method.delivery_tag)