Example #1
0
    def __init__(self, root_dir, pipeline=None, init=False):
        """Initialize Indiana, will create .yax dir if not exists.

        Parameters
        ----------
        root_dir : path to directory
            The current (or eventual) location which contains a yax pipeline.
        pipeline : filepath
            A path to an architectural configuration file. This can only be
            provided if `root_dir` is not already a yax pipeline.

        Raises
        ------
        ValueError
            Raised when `pipeline` provided to an initialized yax pipeline.

        """
        self.root_dir = root_dir
        if not os.path.isdir(self.data_dir):
            if not init:
                raise ValueError("Current directory is not a yax pipeline,"
                                 " see `yax init`.")
            self._init_first_time(pipeline)
        elif pipeline is not None:
            raise ValueError("'pipeline' was provided to an already"
                             " initialized yax pipeline.")

        self.graph = ExeGraph.from_config(self.arch_path)
        self.map = ArtifactMap(self.artifacts_dir, self.artifact_db_path,
                               self.graph)
Example #2
0
    def __init__(self, root_dir, pipeline=None):
        """Initialize Indiana, will create .yax dir if not exists.

        Parameters
        ----------
        root_dir : path to directory
            The current (or eventual) location which contains a yax pipeline.
        pipeline : filepath
            A path to an architectural configuration file. This can only be
            provided if `root_dir` is not already a yax pipeline.

        Raises
        ------
        ValueError
            Raised when `pipeline` provided to an initialized yax pipeline.

        """
        self.root_dir = root_dir
        if not os.path.isdir(self.data_dir):
            self._init_first_time(pipeline)
        elif pipeline is not None:
            raise ValueError("'pipeline' was provided to an already"
                             " initialized yax pipeline.")

        self.graph = ExeGraph.from_config(self.arch_path)
        self.map = ArtifactMap(self.artifacts_dir, self.artifact_db_path,
                               self.graph)
Example #3
0
    def __init__(self, dir_, pipeline=None):
        self.root_dir = dir_
        if not os.path.isdir(self.data_dir):
            self._init_first_time(pipeline)
        elif pipeline is not None:
            raise ValueError("'pipeline' was provided to an already"
                             " initialized yax pipeline.")

        self.graph = ExeGraph.from_config(self.arch_path)
        self.map = ArtifactMap(self.artifact_db_path, self.graph)
Example #4
0
    def __init__(self, dir_, pipeline=None):
        self.root_dir = dir_
        if not os.path.isdir(self.data_dir):
            self._init_first_time(pipeline)
        elif pipeline is not None:
            raise ValueError("'pipeline' was provided to an already"
                             " initialized yax pipeline.")

        self.graph = ExeGraph.from_config(self.arch_path)
        self.map = ArtifactMap(self.artifacts_dir, self.artifact_db_path,
                               self.graph)