mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Don't print config variables twice
CarddavStorage doesn't override the __init__ method, which causes the same spec from DavStorage to be loaded and printed twice.
This commit is contained in:
parent
5ce0d97f91
commit
cf622a75ea
1 changed files with 5 additions and 0 deletions
|
|
@ -542,9 +542,14 @@ def format_storage_config(cls, header=True):
|
|||
|
||||
from ..storage.base import Storage
|
||||
from ..utils import get_class_init_specs
|
||||
handled = set()
|
||||
for spec in get_class_init_specs(cls, stop_at=Storage):
|
||||
defaults = dict(zip(spec.args[-len(spec.defaults):], spec.defaults))
|
||||
for key in spec.args[1:]:
|
||||
if key in handled:
|
||||
continue
|
||||
handled.add(key)
|
||||
|
||||
comment = '' if key not in defaults else '#'
|
||||
value = defaults.get(key, '...')
|
||||
yield '{}{} = {}'.format(comment, key, json.dumps(value))
|
||||
|
|
|
|||
Loading…
Reference in a new issue