def import_file(filename):
    """
    Imports the commodity prices from the given .csv file.
    """
    #file_path = os.path.relpath(filename)
    file_path = os.path.abspath(filename)
    log(DEBUG, "Loading prices from %s", file_path)

    prices = __read_prices_from_file(file_path)
    with BookAggregate(for_writing=True) as svc:
        svc.prices.import_prices(prices)

        print("Saving book...")
        svc.book.save()
def import_file ( filename ) : file_path = os . path . abspath ( filename ) log ( DEBUG , "Loading prices from %s" , file_path ) prices = __read_prices_from_file ( file_path ) with BookAggregate ( for_writing = True ) as svc : svc . prices . import_prices ( prices ) print ( "Saving book..." ) svc . book . save ( )
Imports the commodity prices from the given .csv file.