def __init__(self, fut, file_obj, tid=None):
        """Construct the DataFuture object.

        If the file_obj is a string convert to a File.

        Args:
            - fut (AppFuture) : AppFuture that this DataFuture will track
            - file_obj (string/File obj) : Something representing file(s)

        Kwargs:
            - tid (task_id) : Task id that this DataFuture tracks
        """
        super().__init__()
        self._tid = tid
        if isinstance(file_obj, str):
            self.file_obj = File(file_obj)
        elif isinstance(file_obj, File):
            self.file_obj = file_obj
        else:
            raise ValueError("DataFuture must be initialized with a str or File")
        self.parent = fut
        self._exception = None

        if fut is None:
            logger.debug("Setting result to filepath since no future was passed")
            self.set_result(self.file_obj)

        else:
            if isinstance(fut, Future):
                self.parent.add_done_callback(self.parent_callback)
            else:
                raise NotFutureError("DataFuture can be created only with a FunctionFuture on None")

        logger.debug("Creating DataFuture with parent: %s", self.parent)
        logger.debug("Filepath: %s", self.filepath)
def __init__ ( self , fut , file_obj , tid = None ) : super ( ) . __init__ ( ) self . _tid = tid if isinstance ( file_obj , str ) : self . file_obj = File ( file_obj ) elif isinstance ( file_obj , File ) : self . file_obj = file_obj else : raise ValueError ( "DataFuture must be initialized with a str or File" ) self . parent = fut self . _exception = None if fut is None : logger . debug ( "Setting result to filepath since no future was passed" ) self . set_result ( self . file_obj ) else : if isinstance ( fut , Future ) : self . parent . add_done_callback ( self . parent_callback ) else : raise NotFutureError ( "DataFuture can be created only with a FunctionFuture on None" ) logger . debug ( "Creating DataFuture with parent: %s" , self . parent ) logger . debug ( "Filepath: %s" , self . filepath )
Construct the DataFuture object.

        If the file_obj is a string convert to a File.

        Args:
            - fut (AppFuture) : AppFuture that this DataFuture will track
            - file_obj (string/File obj) : Something representing file(s)

        Kwargs:
            - tid (task_id) : Task id that this DataFuture tracks