Configuration class

This class is a generic configuration parser/writer and doesn’t know much about
how configuration options work. It behaves like a dictionary, and you can look
up keys using subscript notation. For example:

You can update multiple values by calling the update() method with a
dictionary as its argument, just like with Python dictionaries. Finally, if you
want to save the configuration file, you can use the write() method:

>>> conf.write()

Warning

Calling write() overwrites the file that was loaded and comments are
not preserved.

If you wish to save the file to another location, simply pass the path to the
write() method. To reload the configuration, you can use the reload()
method.

HostapdConf class will preserve the order of the configuration keys as much
as possible, but it does not offer methods for inserting configuration options
at random locations.

Helper functions

To help with common configuration tasks, there is a number of helper methods.

Helpers are found in the hosapdconf.helpers module.

>>> from hostapdconf import helpers as ha

Each helper function takes the configuration object as first argument followed
by arguments specific to the setting. Here is a quick overview of the helper
methods: