I want to use if statement and variable assignment in my config file. I have tried but it seems impossible. Right now the "begin" value is read in and the application runs it using python system call. So it will be system( if %(USER_MODE)s=="ADMIN"; then PASSWD: %(ADMIN_PASSWD)s else PASSWD: %(ROOT_PASSWD)s; fi).
config file:
[DEFAULT]
ADMIN_PASSWD: ADMIN
ROOT_PASSWD: ROOT
[setup:password]
begin: if %(USER_MODE)s=="ADMIN"; then PASSWD: %(ADMIN_PASSWD)s else PASSWD: %(ROOT_PASSWD)s; fi
end: echo %(PASSWD)s