From ff6826a816f2080795819f05c0d9dca73343de02 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 11 Jun 2024 13:46:17 +0200 Subject: [PATCH] passing args to process --- xexe/cli.py | 6 ++++-- xexe/processes.py | 12 +++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/xexe/cli.py b/xexe/cli.py index 17e0f21..6afb15b 100644 --- a/xexe/cli.py +++ b/xexe/cli.py @@ -74,11 +74,13 @@ def get_rates( dry_run: bool, output: pathlib.Path, ): - inputs = handle_get_rates_inputs( + get_rates_inputs = handle_get_rates_inputs( start_date=start_date, end_date=end_date, currencies=currencies, dry_run=dry_run, output=output, ) - run_get_rates() + logger.info("Starting get-rates process.") + run_get_rates(**get_rates_inputs) + logger.info("Finished get-rates process.") diff --git a/xexe/processes.py b/xexe/processes.py index ec7c92b..bf3dae9 100644 --- a/xexe/processes.py +++ b/xexe/processes.py @@ -1,8 +1,13 @@ import logging import os +import pathlib +from typing import List +from money.currency import Currency from xecd_rates_client import XecdClient +from xexe.utils import DateRange + logger = logging.getLogger() @@ -44,5 +49,10 @@ def run_xe_healthcheck() -> None: logger.info(account_info_response) -def run_get_rates(): +def run_get_rates( + date_range: DateRange, + currencies: List[Currency], + dry_run: bool, + output: pathlib.Path, +) -> None: logger.info("Getting rates")