From fcdbf515e93cb9d88cb1151818707db0aec56494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Mon, 16 Oct 2017 19:47:17 +0200 Subject: [PATCH] API client: fix date input --- api/client/apiclient.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/client/apiclient.py b/api/client/apiclient.py index 526795e..95e7af9 100644 --- a/api/client/apiclient.py +++ b/api/client/apiclient.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + ''' API client for bocal-site ''' import json @@ -91,7 +93,11 @@ def cmd(func): @cmd def cmd_publish(token, args): - publish_date = date.today() if not args.date else args.date + if not args.date: + publish_date = date.today() + else: + year, month, day = [int(x) for x in args.date.strip().split('-')] + publish_date = date(year=year, month=month, day=day) (ret_code, ret_str) = publish(args.host, token, args.numero,