mirror of
https://github.com/Kozea/Radicale.git
synced 2025-04-05 06:07:35 +03:00
Split the main run function to allow the use of radicale serving programatically. Add an extra_config parameter to the config load to override config.
This commit is contained in:
parent
383409213e
commit
a7549bc652
2 changed files with 10 additions and 1 deletions
|
@ -65,12 +65,16 @@ INITIAL_CONFIG = {
|
|||
"mask_passwords": "True"}}
|
||||
|
||||
|
||||
def load(paths=()):
|
||||
def load(paths=(), extra_config=None):
|
||||
config = ConfigParser()
|
||||
for section, values in INITIAL_CONFIG.items():
|
||||
config.add_section(section)
|
||||
for key, value in values.items():
|
||||
config.set(section, key, value)
|
||||
if extra_config:
|
||||
for section, values in extra_config.items():
|
||||
for key, value in values.items():
|
||||
config.set(section, key, value)
|
||||
for path in paths:
|
||||
if path:
|
||||
config.read(path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue