From e41a17735e455709965972819b89ce449a15d446 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 11 Jun 2015 21:11:04 +1000 Subject: [PATCH] Change pack --exclude behavior, don't touch excluded paths at all Was omitting from zip, but still remapping. --- bam/blend/blendfile_pack.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bam/blend/blendfile_pack.py b/bam/blend/blendfile_pack.py index a74db95..1853c23 100755 --- a/bam/blend/blendfile_pack.py +++ b/bam/blend/blendfile_pack.py @@ -331,6 +331,11 @@ def pack( path_src = blendfile_path_walker.utils.abspath(path_rel, fp.basedir) path_src = os.path.normpath(path_src) + if filename_filter and not filename_filter(path_src): + yield report(" %s: %r\n" % (colorize("exclude", color='yellow'), path_src)) + continue + + # apply variation (if available) if use_variations: if blendfile_levels_dict_curr: @@ -471,8 +476,6 @@ def pack( # in rare cases a filepath could point to a directory if (not os.path.exists(src)) or os.path.isdir(src): yield report(" %s: %r\n" % (colorize("source missing", color='red'), src)) - elif filename_filter and not filename_filter(src): - yield report(" %s: %r\n" % (colorize("exclude", color='yellow'), src)) else: yield report(" %s: %r -> %r\n" % (colorize("copying", color='blue'), src, dst)) shutil.copy(src, dst) @@ -511,8 +514,6 @@ def pack( # in rare cases a filepath could point to a directory if (not os.path.exists(src)) or os.path.isdir(src): yield report(" %s: %r\n" % (colorize("source missing", color='red'), src)) - elif filename_filter and not filename_filter(src): - yield report(" %s: %r\n" % (colorize("exclude", color='yellow'), src)) else: yield report(" %s: %r -> \n" % (colorize("copying", color='blue'), src)) zip_handle.write(