Browse files

Updating plug-in interface

  • Loading branch information...
mottosso committed Oct 3, 2014
1 parent 350d340 commit 1467a780895c7029cfc0eb4ea40b747162d96fdc
Showing with 37 additions and 4 deletions.
  1. +0 −1 napoleon/
  2. +37 −3 napoleon/
@@ -1,7 +1,6 @@
"""Mock-up of simplified pipeline"""
import os
import cquery
def public_dir(asset_dir):
@@ -16,11 +16,45 @@ class Extractor(pyblish.Extractor):
def temp_dir(self):
"""Provide a temporary directory in which to store files"""
temp_dir = tempfile.mkdtemp()
self._temp_dir = tempfile.mkdtemp()
yield temp_dir
yield self._temp_dir
self._temp_dir = None
def commit(self, instance):
"""Move `instance` relative current workspace
instance (Instance): Instance to be committed
if not self._temp_dir:
raise pyblish.ExtractionError("Cannot commit outside of "
"temporary directory. Use "
"self.temp_dir() first")
temp_dir = self._temp_dir
commit_dir = self.compute_commit_directory(instance=instance)"Moving {0} relative working file..".format(instance))
if os.path.isdir(commit_dir):"Existing directory found, merging..")
for fname in os.listdir(temp_dir):
abspath = os.path.join(temp_dir, fname)
commit_path = os.path.join(commit_dir, fname)
shutil.copy(abspath, commit_path)
else:"No existing directory found, creating..")
shutil.copytree(temp_dir, commit_dir)
# Persist path of commit within instance
instance.set_data('commit_dir', value=commit_dir)
return commit_dir
class Conformer(pyblish.Conformer):

0 comments on commit 1467a78

Please sign in to comment.