On 06/06/2013 05:24 PM, Christian Boltz wrote: > Hello, > > Am Freitag, 7. Juni 2013 schrieb Kshitij Gupta: >> @John as suggested I used the configparser module and as it turns out >> we do have a problem with using it. Actually in the config files at >> present the default section is represented by an empty string (for >> e.g. in /etc/apparmor/easyprof.conf ), but configparser needs a none >> empty section header and hence raises an Error for the same. > > We have several styles of config files: yes its a bit of a pain > a) INI-like files (logprof.conf) - configparser can handle them > b) shell-style config files (easyprof.conf, notify.conf, subdomain.conf) > with parameter=value or parameter="value" lines > c) XML (reports.conf, which isn't used anymore)
I'll take this farther and say please ignore reports.conf, its deprecated > d) a CSV-line style + comments (severity.db, separated by whitespace) > e) a mix of "parameter" and "parameter=value" (parser.conf) right, though we could extend this to be parameter=true for the parameter case and allow for parameter="value" the parser could retain support for lines of just parameter but a new tool wouldn't have to necessarily support the new format. That should bring parser.conf into the shell-style class of files as it already supports # as the comment I wouldn't be adverse to shoving simple parsing for this into the library. -- AppArmor mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
