From cef0cd57a0877bc323fa5b71fa22ee08a4e39935 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 5 Jul 2018 10:40:04 +0200 Subject: [PATCH] Simplify validate transfers and improve non-verbose log readability --- colorbleed/plugins/maya/publish/validate_transfers.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/colorbleed/plugins/maya/publish/validate_transfers.py b/colorbleed/plugins/maya/publish/validate_transfers.py index 7fb50567c1..5f1f5b3f41 100644 --- a/colorbleed/plugins/maya/publish/validate_transfers.py +++ b/colorbleed/plugins/maya/publish/validate_transfers.py @@ -28,22 +28,21 @@ class ValidateTransfers(pyblish.api.InstancePlugin): for source, destination in transfers: collected[destination.lower()].add(source.lower()) - invalid = False invalid_destinations = list() for destination, sources in collected.items(): if len(sources) > 1: + invalid_destinations.append(destination) + if verbose: self.log.error("Non-unique file transfer for resources: " "{0} (sources: {1})".format(destination, sources)) - invalid = True - invalid_destinations.append(destination) - if invalid: + if invalid_destinations: if not verbose: # If not verbose then still log the resource destination as # opposed to every individual file transfer self.log.error("Non-unique file transfers to destinations: " - "%s" % invalid_destinations) + "%s" % "\n".join(invalid_destinations)) raise RuntimeError("Invalid transfers in queue.")