1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-09 04:49:17 +00:00

trans gets replaced with trans_read in dotfiles

This commit is contained in:
deadc0de6
2019-06-09 17:50:06 +02:00
parent acc2c83e22
commit 9df3522a17
3 changed files with 12 additions and 3 deletions

View File

@@ -292,16 +292,24 @@ class CfgYaml:
return new
def _norm_dotfiles(self, dotfiles):
"""add 'src' as 'key if not present"""
"""normalize dotfiles entries"""
if not dotfiles:
return dotfiles
new = {}
for k, v in dotfiles.items():
# add 'src' as key' if not present
if self.key_dotfile_src not in v:
v[self.key_dotfile_src] = k
new[k] = v
else:
new[k] = v
# fix deprecated trans key
if self.old_key_trans_r in k:
msg = '\"trans\" is deprecated, please use \"trans_read\"'
self.log.warn(msg)
v[self.key_trans_r] = v[self.old_key_trans_r].copy()
del v[self.old_key_trans_r]
new[k] = v
return new
def _get_variables_dict(self, profile, seen, sub=False):