Harangued is a small library for managing adding or removing additional lines to standard (and normally system) configuration files.
Harangued provides a context manager which can be used to manage your app additions to a configuration file which is common with other apps, including other apps using Harangued, or human editors and make changes to those config files in their own guarded sections.
Harangued can be used like this:
with Haranguer("/path/to/file") as my_lines:
for line in my_lines.data:
# Verify line
pass
my_lines.data.append("extra line")This will result in a section being added to the config file like this.
Some config line
################## begin Block - Generated by Haranguer ##################
an existing config line
extra line
################## end Block - Generated by Haranguer ##################