replace currecny package, use set not list

This commit is contained in:
Pablo Martin 2024-06-11 13:34:49 +02:00
parent 19eea483e5
commit 1fbdfb34c0
2 changed files with 5 additions and 5 deletions

View file

@ -1,7 +1,7 @@
import pathlib import pathlib
from dataclasses import dataclass from dataclasses import dataclass
from currencies import Currency from money.currency import Currency
DEFAULT_CURRENCIES = {Currency("EUR"), Currency("GBP"), Currency("USD")} DEFAULT_CURRENCIES = {Currency("EUR"), Currency("GBP"), Currency("USD")}

View file

@ -3,7 +3,7 @@ import logging
import pathlib import pathlib
from typing import Union from typing import Union
from currencies import Currency from money.currency import Currency
from xexe.constants import DEFAULT_CURRENCIES from xexe.constants import DEFAULT_CURRENCIES
from xexe.utils import DateRange from xexe.utils import DateRange
@ -26,9 +26,9 @@ def handle_get_rates_inputs(
date_range.end_date = datetime.datetime.today().date() date_range.end_date = datetime.datetime.today().date()
if currencies: if currencies:
# CLI input comes as string of comma-separated currency codes # CLI input comes as a string of comma-separated currency codes
currencies = [currency_code.strip() for currency_code in currencies.split(",")] currencies = {currency_code.strip() for currency_code in currencies.split(",")}
tmp = [Currency(currency_code) for currency_code in currencies] tmp = {Currency(currency_code) for currency_code in currencies}
currencies = tmp currencies = tmp
if currencies is None: if currencies is None: