Moved hardcode to constants
This commit is contained in:
parent
b00a95cee5
commit
b966559ff0
2 changed files with 8 additions and 3 deletions
|
|
@ -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()
|
||||||
|
|
@ -21,3 +25,4 @@ custom_meta_data_keys.sats_received = "sats_received"
|
||||||
|
|
||||||
um_first_agreement_percentage = 0.5
|
um_first_agreement_percentage = 0.5
|
||||||
bbo_royalty_fee = 0.2
|
bbo_royalty_fee = 0.2
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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"],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue