Exemplo n.º 1
0
    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 !')
Exemplo n.º 2
0
    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 !')