Moved hardcode to constants

This commit is contained in:
counterweight 2023-09-03 05:20:31 +02:00
parent b00a95cee5
commit b966559ff0
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
2 changed files with 8 additions and 3 deletions

View file

@ -1,5 +1,9 @@
from types import SimpleNamespace from types import SimpleNamespace
### Config
DEFAULT_DOTENV_FILEPATH = ".camisatoshi-wordpress-reports/.env"
### Order keys ### Order keys
order_keys = SimpleNamespace() order_keys = SimpleNamespace()
@ -20,4 +24,5 @@ custom_meta_data_keys.sats_received = "sats_received"
### Other ### Other
um_first_agreement_percentage = 0.5 um_first_agreement_percentage = 0.5
bbo_royalty_fee = 0.2 bbo_royalty_fee = 0.2

View file

@ -8,11 +8,11 @@ from woocommerce import API
from camisatoshi_wordpress_reports.order import Order, Orders from camisatoshi_wordpress_reports.order import Order, Orders
from camisatoshi_wordpress_reports.constants import ( from camisatoshi_wordpress_reports.constants import (
um_first_agreement_percentage, um_first_agreement_percentage, DEFAULT_DOTENV_FILEPATH,
) )
API_CONFIG = dotenv_values( API_CONFIG = dotenv_values(
dotenv_path=Path.home() / Path(".camisatoshi-wordpress-reports/.env") dotenv_path=Path.home() / Path(DEFAULT_DOTENV_FILEPATH)
) )
WC_API = API( WC_API = API(
url=API_CONFIG["URL"], url=API_CONFIG["URL"],