Beispiel #1
0
    def get_operations_results(operation_gid):
        operation = ProjectService.load_operation_lazy_by_gid(operation_gid)
        if operation is None:
            get_logger().warning("Invalid operation GID: {}".format(operation_gid))
            raise InvalidIdentifierException()

        data_types = ProjectService.get_results_for_operation(operation.id)
        if data_types is None:
            return []

        return [DataTypeDto(datatype) for datatype in data_types]
Beispiel #2
0
    def get(self, operation_gid):
        """
        :return list of DataType instances (subclasses), representing the results of that operation if it has finished and
        None, if the operation is still running, has failed or simply has no results.
        """
        operation = ProjectService.load_operation_lazy_by_gid(operation_gid)
        if operation is None:
            raise InvalidIdentifierException(INVALID_OPERATION_GID_MESSAGE % operation_gid)

        data_types = ProjectService.get_results_for_operation(operation.id)
        if data_types is None:
            return []

        return [DataTypeDto(datatype) for datatype in data_types]