def taxi_service(city_origin, state_origin, city_destiny, state_destiny, coin): origin = Origin(city=city_origin, state=state_origin) destiny = Destiny(city=city_destiny, state=state_destiny) coin_manager = CoinManager(coin) coin_manager.create() road_trip_manager = RoadTripManager(origin, destiny, coin_manager) road_trip_manager.create() road_trip_price = RoadTripPrice(road_trip_manager) result_price = road_trip_price.total_price return { 'origin': { 'latitude': origin.latitude, 'longitude': origin.longitude, 'zip_code': origin.zip_code }, 'destiny': { 'latitude': destiny.latitude, 'longitude': destiny.longitude, 'zip_code': destiny.zip_code }, 'km_distance': road_trip_manager.km_distance, 'gasoline_price': road_trip_manager.gasoline_price, 'total_price': result_price.price, 'total_price_formatted': result_price.formatted }
from model import Origin, Destiny, RoadTripManager, RoadTripPrice from model.coin_manager import CoinManager import sys if __name__ == '__main__': # python main.py new%20york ny san%20francisco ca BRL origin = Origin(city=sys.argv[1], state=sys.argv[2]) destiny = Destiny(city=sys.argv[3], state=sys.argv[4]) coin = sys.argv[5] coin_manager = CoinManager(coin) coin_manager.create() road_trip_manager = RoadTripManager(origin, destiny, coin_manager) road_trip_manager.create() road_trip_price = RoadTripPrice(road_trip_manager) print road_trip_price.total_price