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

trans_r and trans_w are not list anymore

This commit is contained in:
deadc0de6
2019-06-11 12:34:31 +02:00
parent d6d5ea2ccf
commit e0bbef6fb2
4 changed files with 25 additions and 36 deletions

View File

@@ -545,17 +545,17 @@ def apply_trans(dotpath, dotfile, debug=False):
"""
src = dotfile.src
new_src = '{}.{}'.format(src, TRANS_SUFFIX)
for trans in dotfile.trans_r:
if debug:
LOG.dbg('executing transformation {}'.format(trans))
s = os.path.join(dotpath, src)
temp = os.path.join(dotpath, new_src)
if not trans.transform(s, temp):
msg = 'transformation \"{}\" failed for {}'
LOG.err(msg.format(trans.key, dotfile.key))
if new_src and os.path.exists(new_src):
remove(new_src)
return None
trans = dotfile.trans_r
if debug:
LOG.dbg('executing transformation {}'.format(trans))
s = os.path.join(dotpath, src)
temp = os.path.join(dotpath, new_src)
if not trans.transform(s, temp):
msg = 'transformation \"{}\" failed for {}'
LOG.err(msg.format(trans.key, dotfile.key))
if new_src and os.path.exists(new_src):
remove(new_src)
return None
return new_src