mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
registry: Add a header to the configuration file telling not to edit it.
This commit is contained in:
parent
6a912bbbe2
commit
721cb06dcd
@ -108,9 +108,24 @@ def open_registry(filename, clear=False):
|
|||||||
_lastModified = time.time()
|
_lastModified = time.time()
|
||||||
_fd.close()
|
_fd.close()
|
||||||
|
|
||||||
|
CONF_FILE_HEADER = """
|
||||||
|
######
|
||||||
|
# Althrough it is technically possible to do so, we do not recommend that
|
||||||
|
# you edit this file with a text editor.
|
||||||
|
# Whenever possible, do it on IRC using the Config plugin, which
|
||||||
|
# checks values you set are valid before writing them to the
|
||||||
|
# configuration.
|
||||||
|
# Moreover, if you edit this file while the bot is running, your
|
||||||
|
# changes may be lost.
|
||||||
|
######
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
def close(registry, filename, private=True):
|
def close(registry, filename, private=True):
|
||||||
first = True
|
first = True
|
||||||
fd = utils.file.AtomicFile(filename)
|
fd = utils.file.AtomicFile(filename)
|
||||||
|
fd.write(CONF_FILE_HEADER)
|
||||||
for (name, value) in registry.getValues(getChildren=True):
|
for (name, value) in registry.getValues(getChildren=True):
|
||||||
help = value.help()
|
help = value.help()
|
||||||
if help:
|
if help:
|
||||||
|
Loading…
Reference in New Issue
Block a user