Compare commits

...

2 Commits

Author SHA1 Message Date
Frédéric Tronel
4b3c6a33c0 Add a configuration file example. 2025-08-30 08:59:35 +02:00
Frédéric Tronel
856e7fc034 Improvement of configuration file. 2025-08-30 08:57:50 +02:00
3 changed files with 13 additions and 2 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
venv/
*.ics
config

View File

@@ -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)

5
config.example Normal file
View File

@@ -0,0 +1,5 @@
[Login]
login=[my_login]
password=[my_password]
[Espace]
ville=[my_city]