From eac9509c750651b0efe1ad72c19971739baadbcc Mon Sep 17 00:00:00 2001 From: Marcel Robitaille Date: Fri, 25 Jan 2019 16:27:02 -0400 Subject: [PATCH] `install()` to return single dotfile not flat list --- dotdrop/installer.py | 5 +---- dotdrop/utils.py | 5 ----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/dotdrop/installer.py b/dotdrop/installer.py index 1b41ee4..88daa50 100644 --- a/dotdrop/installer.py +++ b/dotdrop/installer.py @@ -118,7 +118,6 @@ class Installer: srcs = [os.path.join(parent, child) for child in children] dsts = [os.path.join(dst, child) for child in children] - results = [] for i in range(len(children)): src = srcs[i] dst = dsts[i] @@ -141,9 +140,7 @@ class Installer: if len(result): actions = [] - results.append(result) - - return utils.flatten(results) + return (src, dst) def _link(self, src, dst, actions=[]): """set src as a link target of dst""" diff --git a/dotdrop/utils.py b/dotdrop/utils.py index e08af6e..bf3e979 100644 --- a/dotdrop/utils.py +++ b/dotdrop/utils.py @@ -113,11 +113,6 @@ def strip_home(path): return path -def flatten(a): - """flatten list""" - return functools.reduce(operator.iconcat, a, []) - - def must_ignore(paths, ignores, debug=False): """return true if any paths in list matches any ignore patterns""" if not ignores: