def update_predictions(agencies=None): """ Get the latest vehicle arrival predictions from Nextbus """ start = time.time() if not agencies: agencies = app.config['AGENCIES'] prediction_count = len(Nextbus.get_predictions(agencies, truncate=False)) elapsed = time.time() - start print("Got {0} predictions for {1} agencies in {2:0.2f} sec."\ .format(prediction_count, len(agencies), elapsed))
def update_predictions(agencies=None): """ Get the latest vehicle arrival predictions from Nextbus """ start = time.time() if not agencies: agencies = app.config['AGENCIES'] prediction_count = len(Nextbus.get_predictions(agencies, truncate=False)) elapsed = time.time() - start print("Got {0} predictions for {1} agencies in {2:0.2f} sec."\ .format(prediction_count, len(agencies), elapsed))
def do_it(agencies): from nextbus import Nextbus from models import Agency start = time.time() if agencies: agencies = agencies.split(",") if not agencies: agencies = app.config['AGENCIES'] prediction_count = len(Nextbus.get_predictions(agencies, truncate=False)) elapsed = time.time() - start print("Got {0} predictions for {1} agencies in {2:0.2f} seconds."\ .format(prediction_count, len(agencies), elapsed))
def do_it(agencies): from nextbus import Nextbus from models import Agency start = time.time() if agencies: agencies = agencies.split(",") if not agencies: agencies = app.config['AGENCIES'] prediction_count = len( Nextbus.get_predictions(agencies, truncate=False)) elapsed = time.time() - start print("Got {0} predictions for {1} agencies in {2:0.2f} seconds."\ .format(prediction_count, len(agencies), elapsed))