August 2016
Beginner to intermediate
665 pages
14h 11m
English
When it comes to configuration files and parsing them, you have a lot of options, from simple to complicated.
We could, of course, simply store what we want in JSON, but that format is a little tricky to work directly for humans—it will require escaping characters and so on, which makes it vulnerable to errors.
Instead, we'll keep things simple by using a standard ini config file library in gcfg, which handles gitconfig files and traditional, old school .ini format, as shown in the following code snippet:
[revisions] count = 2 revisionsuffix = .rev lockfiles = false [logs] rotatelength = 86400 [alarms] emails = sysadmin@example.com,ceo@example.com
You can find gcfg at https://code.google.com/p/gcfg/.
Essentially, this ...
Read now
Unlock full access