~forest/capsul-flask

f3630fbacfdb953512f2a2904929c5f37eb96bef — forest 2 months ago f94d3aa master
account-balance cli command
1 files changed, 12 insertions(+), 0 deletions(-)

M capsulflask/cli.py
M capsulflask/cli.py => capsulflask/cli.py +12 -0
@@ 62,6 62,18 @@ def sql_script(f, c):

    model.connection.commit()

@bp.cli.command('account-balance')
@click.option('-u', help='users email address')
@with_appcontext
def account_balance(u):
  vms = get_model().list_vms_for_account(u)
  payments = get_model().list_payments_for_account(u)
  click.echo(".")
  click.echo(".")
  click.echo(get_account_balance(vms, payments, datetime.utcnow()))
  click.echo(".")



@bp.cli.command('cron-task')
@with_appcontext