예제 #1
0
파일: engine.py 프로젝트: mckelvin/Yaafe
    def load(self, dataflow):
        """
            Configure engine according to the given dataflow.

            :param dataflow: dataflow object or filename of a dataflow file.
            :type dataflow: :py:class:`DataFlow` or string
            :return: True on success, False on fail.
        """
        if type(dataflow) is str:
            df = DataFlow()
            if df.load(dataflow):
                dataflow = df
        if type(dataflow) is DataFlow:
            return yc.engine_load(self.ptr, dataflow.ptr) and True or False
        raise TypeError('dataflow parameter must be a DataFlow object or '
                        'dataflow filename !')
예제 #2
0
파일: engine.py 프로젝트: tudou2015/Yaafe
    def load(self, dataflow):
        """
            Configure engine according to the given dataflow.

            :param dataflow: dataflow object or filename of a dataflow file.
            :type dataflow: :py:class:`DataFlow` or string
            :return: True on success, False on fail.
        """
        if type(dataflow) is str:
            df = DataFlow()
            if df.load(dataflow):
                dataflow = df
        if type(dataflow) is DataFlow:
            return yc.engine_load(self.ptr, dataflow.ptr) and True or False
        raise TypeError('dataflow parameter must be a DataFlow object or '
                        'dataflow filename !')