Skip to content

Commit 7302974

Browse files
author
Alan Christie
committed
fix: Adds --verbose to coins.py
1 parent cd541ac commit 7302974

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tools/coins.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ def main(c_args: argparse.Namespace) -> None:
3737
# This gives us the product's allowance, limit and overspend multipliers
3838
p_rv: AsApiRv = AsApi.get_product(token, product_id=args.product)
3939
assert p_rv.success
40+
if args.verbose:
41+
pprint(p_rv.msg)
42+
4043
allowance: Decimal = Decimal(p_rv.msg["product"]["coins"]["allowance"])
4144
allowance_multiplier: Decimal = Decimal(p_rv.msg["product"]["coins"]["allowance_multiplier"])
4245
limit: Decimal = Decimal(p_rv.msg["product"]["coins"]["limit"])
@@ -56,8 +59,8 @@ def main(c_args: argparse.Namespace) -> None:
5659
assert pc_rv.success
5760
invoice["From"] = pc_rv.msg["from"]
5861
invoice["Until"] = pc_rv.msg["until"]
59-
60-
# pprint(pc_rv.msg)
62+
if args.verbose:
63+
pprint(pc_rv.msg)
6164

6265
# Accumulate all the storage costs
6366
# (excluding the current which will be interpreted as the "burn rate")
@@ -187,6 +190,11 @@ def _calculate_adjusted_coins(total_coins: Decimal,
187190
description="Calculates a Product's Coin Charges (actual and predicted)"
188191
)
189192
parser.add_argument('product', type=str, help='The Product UUID')
193+
parser.add_argument(
194+
'--verbose',
195+
help='Set to print extra information',
196+
action='store_true',
197+
)
190198
args: argparse.Namespace = parser.parse_args()
191199

192200
main(args)

0 commit comments

Comments
 (0)