1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 21:29:43 +00:00

First implementation of import coinfigs: brutally merging dictionary members

This commit is contained in:
Davide Laezza
2019-04-19 21:39:59 +02:00
parent 02bae593e5
commit bcf89478ba
4 changed files with 37 additions and 14 deletions

View File

@@ -157,7 +157,7 @@ def yaml_dashed_list(items, indent=0):
def create_fake_config(directory, configname='config.yaml',
dotpath='dotfiles', backup=True, create=True,
import_profiles=()):
import_configs=()):
"""Create a fake config file"""
path = os.path.join(directory, configname)
workdir = os.path.join(directory, 'workdir')
@@ -167,9 +167,9 @@ def create_fake_config(directory, configname='config.yaml',
f.write(' create: {}\n'.format(str(create)))
f.write(' dotpath: {}\n'.format(dotpath))
f.write(' workdir: {}\n'.format(workdir))
if import_profiles:
f.write(' import_profiles:\n')
f.write(yaml_dashed_list(import_profiles, 4))
if import_configs:
f.write(' import_configs:\n')
f.write(yaml_dashed_list(import_configs, 4))
f.write('dotfiles:\n')
f.write('profiles:\n')
f.write('actions:\n')

View File

@@ -217,7 +217,7 @@ profiles:
dotpath=self.CONFIG_DOTPATH,
backup=self.CONFIG_BACKUP,
create=self.CONFIG_CREATE,
import_profiles=(imported,))
import_configs=(imported,))
# keys
keys = {