How to use the pyodm.types.TaskStatus function in pyodm

To help you get started, we’ve selected a few pyodm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpenDroneMap / PyODM / pyodm / types.py View on Github external
def __init__(self, json):
        self.uuid = json['uuid']
        self.name = json['name']
        self.date_created = datetime.utcfromtimestamp(int(json['dateCreated'] / 1000.0))
        self.processing_time = json['processingTime']
        self.status = TaskStatus(json['status']['code'])
        self.last_error = json['status'].get('errorMessage', '')
        self.options = json['options']
        self.images_count = json['imagesCount']
        self.progress = json.get('progress', 0)
        self.output = json.get('output', [])
github OpenDroneMap / ODM / opendm / remote.py View on Github external
def status_callback(info):
                    # If a task switches from RUNNING to QUEUED, then we need to 
                    # stop the process and re-add the task to the queue.
                    if info.status == TaskStatus.QUEUED:
                        log.ODM_WARNING("LRE: %s (%s) turned from RUNNING to QUEUED. Re-adding to back of the queue." % (self, task.uuid))
                        raise NodeTaskLimitReachedException("Delayed task limit reached")
                    elif info.status == TaskStatus.RUNNING:
                        # Print a status message once in a while
                        nonloc.status_callback_calls += 1
                        if nonloc.status_callback_calls > 30:
                            log.ODM_INFO("LRE: %s (%s) is still running" % (self, task.uuid))
                            nonloc.status_callback_calls = 0
                try:
github OpenDroneMap / PyODM / pyodm / api.py View on Github external
while True:
            try:
                info = self.info()
            except NodeConnectionError as e:
                if retry < max_retries:
                    retry += 1
                    time.sleep(retry * retry_timeout)
                    continue
                else:
                    raise e

            retry = 0
            if status_callback is not None:
                status_callback(info)

            if info.status in [TaskStatus.COMPLETED, TaskStatus.CANCELED, TaskStatus.FAILED]:
                break

            time.sleep(interval)

        if info.status in [TaskStatus.FAILED, TaskStatus.CANCELED]:
            raise TaskFailedError(info.status)