return disabled cleanup plugin

This commit is contained in:
Milan Kolar 2019-05-27 23:51:41 +01:00
parent 4ea25d3418
commit d339cade16

View file

@ -16,21 +16,21 @@ class CleanUp(pyblish.api.InstancePlugin):
exclude_families = ["clip"]
def process(self, instance):
# if [ef for ef in self.exclude_families
# if instance.data["family"] in ef]:
# return
# import tempfile
#
# staging_dir = instance.data.get("stagingDir", None)
# if not staging_dir or not os.path.exists(staging_dir):
# self.log.info("No staging directory found: %s" % staging_dir)
# return
#
# temp_root = tempfile.gettempdir()
# if not os.path.normpath(staging_dir).startswith(temp_root):
# self.log.info("Skipping cleanup. Staging directory is not in the "
# "temp folder: %s" % staging_dir)
# return
#
# self.log.info("Removing temporary folder ...")
# shutil.rmtree(staging_dir)
if [ef for ef in self.exclude_families
if instance.data["family"] in ef]:
return
import tempfile
staging_dir = instance.data.get("stagingDir", None)
if not staging_dir or not os.path.exists(staging_dir):
self.log.info("No staging directory found: %s" % staging_dir)
return
temp_root = tempfile.gettempdir()
if not os.path.normpath(staging_dir).startswith(temp_root):
self.log.info("Skipping cleanup. Staging directory is not in the "
"temp folder: %s" % staging_dir)
return
self.log.info("Removing temporary folder ...")
shutil.rmtree(staging_dir)