コード例 #1
0
ファイル: artifact.py プロジェクト: tomspur/dexy
    def create_working_dir(self, populate=False):
        tmpdir = self.tmp_dir()
        shutil.rmtree(tmpdir, ignore_errors=True)
        os.mkdir(tmpdir)

        if populate:
            for key, doc in self.runner.completed.iteritems():
                if isinstance(doc, dexy.doc.Doc):
                    filename = os.path.join(tmpdir, doc.final_artifact.name)
                    parent_dir = os.path.dirname(filename)
                    if not os.path.exists(parent_dir):
                        os.makedirs(parent_dir)
                    doc.output().output_to_file(filename)

            input_filepath = os.path.join(tmpdir, self.prior.name)

        parent_dir = os.path.dirname(input_filepath)
        if not os.path.exists(parent_dir):
            os.makedirs(parent_dir)
        self.input_data.output_to_file(input_filepath)
        return parent_dir
コード例 #2
0
ファイル: artifact.py プロジェクト: tomspur/dexy
    def create_working_dir(self, populate=False):
        tmpdir = self.tmp_dir()
        shutil.rmtree(tmpdir, ignore_errors=True)
        os.mkdir(tmpdir)

        if populate:
            for key, doc in self.runner.completed.iteritems():
                if isinstance(doc, dexy.doc.Doc):
                    filename = os.path.join(tmpdir, doc.final_artifact.name)
                    parent_dir = os.path.dirname(filename)
                    if not os.path.exists(parent_dir):
                        os.makedirs(parent_dir)
                    doc.output().output_to_file(filename)

            input_filepath = os.path.join(tmpdir, self.prior.name)

        parent_dir = os.path.dirname(input_filepath)
        if not os.path.exists(parent_dir):
            os.makedirs(parent_dir)
        self.input_data.output_to_file(input_filepath)
        return parent_dir
コード例 #3
0
ファイル: artifact.py プロジェクト: adityaathalye/dexy
    def create_working_dir(self, input_filename, populate=False):
        tmpdir = self.tmp_dir()

        shutil.rmtree(tmpdir, ignore_errors=True)
        os.mkdir(tmpdir)

        if populate:
            for doc in self.doc.completed_children.values():
                if isinstance(doc, dexy.doc.Doc):
                    filename = os.path.join(tmpdir, doc.output().name)
                    parent_dir = os.path.dirname(filename)
                    if not os.path.exists(parent_dir):
                        os.makedirs(parent_dir)
                    doc.output().output_to_file(filename)

        parent_dir = os.path.join(tmpdir, self.input_data.parent_dir())
        input_filepath = os.path.join(parent_dir, input_filename)

        if not os.path.exists(parent_dir):
            os.makedirs(parent_dir)

        self.input_data.output_to_file(input_filepath)