From 856e7fc03434dfcb2ec0ccf5d8be5bf1222fcfc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tronel?= Date: Sat, 30 Aug 2025 08:57:50 +0200 Subject: [PATCH] Improvement of configuration file. --- citoyen.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/citoyen.py b/citoyen.py index e10b480..6fc25e0 100755 --- a/citoyen.py +++ b/citoyen.py @@ -212,7 +212,7 @@ def main(): parserdump.add_argument("-o", "--output", dest='calendar', required=True, default='cal.ics', help="Output calendar file.") args = parser.parse_args() - logger.info("Initial arguments: %s" % args) + logger.debug("Initial arguments: %s" % args) if args.debug: logger.info('Setting logging to debug mode') @@ -236,8 +236,12 @@ def main(): args.login = config.get('Login','login') if 'password' in options: args.password = config.get('Login','password') + if 'Espace' in sections: + options = config.options('Espace') + if 'ville' in options: + args.city = config.get('Espace', 'ville') - logger.info("Final arguments: %s" % args) + logger.debug("Final arguments: %s" % args) if args.city == None: logger.info('City must be provided.') @@ -271,6 +275,7 @@ def main(): resaNum+=1 elif (args.command == 'D'): resaType = list(resaTypes)[args.index-1] + logger.info('Retrieve reservations for "%s"' % resaType) url = resaTypes[resaType] dumpReservation(resaType, baseURL, args.city, url, cookies, args.calendar)