예제 #1
0
    def fetch_task(self, task_id):
        response = self.client.get(self.route.task % task_id,
                                   data=json.dumps({}))
        raise_if_error("task", response)

        task_data = response.json()
        return task_data
예제 #2
0
    def submit_results(self, task_id, results):
        data = {"task_id": task_id, "results": results}

        response = self.client.post(self.route.mock_results,
                                    data=json.dumps(data))
        raise_if_error("result submission", response)
        return response.json()
예제 #3
0
 def get_task_results_by_taskworker_id(self, taskworker_id):
     try:
         response = self.client.get(self.route.task_worker_results % taskworker_id, data={})
         raise_if_error("process result", response)
         results = response.json()
         return results
     except Exception as e:
         return None
예제 #4
0
    def submit_results(self, task_id, results):
        data = {
            "task_id": task_id,
            "results": results
        }

        response = self.client.post(self.route.mock_results, data=json.dumps(data))
        raise_if_error("result submission", response)
        return response.json()
예제 #5
0
    def add_data(self, project_key, tasks, rerun_key):
        response = self.client.post(self.route.add_tasks % project_key, data=json.dumps({
            "tasks": tasks,
            "rerun_key": rerun_key
        }))

        raise_if_error("publish project", response)

        return response.json()
예제 #6
0
 def get_task_results_by_taskworker_id(self, taskworker_id):
     try:
         response = self.client.get(self.route.task_worker_results %
                                    taskworker_id,
                                    data={})
         raise_if_error("process result", response)
         results = response.json()
         return results
     except Exception as e:
         return None
예제 #7
0
    def add_data(self, project_key, tasks, rerun_key):
        response = self.client.post(self.route.add_tasks % project_key,
                                    data=json.dumps({
                                        "tasks": tasks,
                                        "rerun_key": rerun_key
                                    }))

        raise_if_error("publish project", response)

        return response.json()
예제 #8
0
    def launch_peer_review(self, task_workers, inter_task_review, rerun_key):
        data = {
            "task_workers": task_workers,
            "inter_task_review": inter_task_review,
            "rerun_key": rerun_key
        }

        response = self.client.post(self.route.peer_review, data=json.dumps(data))
        raise_if_error("peer review", response)
        return response.json()
예제 #9
0
    def launch_peer_review(self, task_workers, inter_task_review, rerun_key):
        data = {
            "task_workers": task_workers,
            "inter_task_review": inter_task_review,
            "rerun_key": rerun_key
        }

        response = self.client.post(self.route.peer_review,
                                    data=json.dumps(data))
        raise_if_error("peer review", response)
        return response.json()
예제 #10
0
    def update_approval_status(self, task):
        log.debug(msg="updating status for task worker %d" % task["taskworker_id"])

        STATUS_ACCEPTED = 3
        STATUS_REJECTED = 4

        data = {
            "status": STATUS_ACCEPTED if task["accept"] else STATUS_REJECTED,
            "workers": [task["taskworker_id"]]
        }

        response = self.client.post(self.route.update_task_status, data=json.dumps(data))
        raise_if_error("task approval", response)

        return response.json()
예제 #11
0
    def update_approval_status(self, task):
        log.debug(msg="updating status for task worker %d" %
                  task["taskworker_id"])

        STATUS_ACCEPTED = 3
        STATUS_REJECTED = 4

        data = {
            "status": STATUS_ACCEPTED if task["accept"] else STATUS_REJECTED,
            "workers": [task["taskworker_id"]]
        }

        response = self.client.post(self.route.update_task_status,
                                    data=json.dumps(data))
        raise_if_error("task approval", response)

        return response.json()
예제 #12
0
    def fetch_task_status(self, task_id):
        response = self.client.get(self.route.task_status % task_id, data={})
        raise_if_error("task status", response)

        task_data = response.json()
        return task_data
예제 #13
0
    def fetch_task(self, task_id):
        response = self.client.get(self.route.task % task_id, data=json.dumps({}))
        raise_if_error("task", response)

        task_data = response.json()
        return task_data
예제 #14
0
    def fetch_config(self, rerun_key):
        response = self.client.get(self.route.rerun_config % rerun_key,
                                   data=json.dumps({}))
        raise_if_error("publish project", response)

        return response.json()
예제 #15
0
    def publish_project(self, project_id):
        response = self.client.post(self.route.publish_project % project_id,
                                    data=json.dumps({}))
        raise_if_error("publish project", response)

        return response.json()
예제 #16
0
    def publish_project(self, project_id):
        response = self.client.post(self.route.publish_project % project_id, data=json.dumps({}))
        raise_if_error("publish project", response)

        return response.json()
예제 #17
0
    def fetch_config(self, rerun_key):
        response = self.client.get(self.route.rerun_config % rerun_key, data=json.dumps({}))
        raise_if_error("publish project", response)

        return response.json()
예제 #18
0
    def boomerang_feedback(self, data):
        response = self.client.post(self.route.boomerang_rating, data=json.dumps(data))
        raise_if_error("rating", response)

        return response.json()
예제 #19
0
    def boomerang_feedback(self, data):
        response = self.client.post(self.route.boomerang_rating,
                                    data=json.dumps(data))
        raise_if_error("rating", response)

        return response.json()
예제 #20
0
    def fetch_task_status(self, task_id):
        response = self.client.get(self.route.task_status % task_id, data={})
        raise_if_error("task status", response)

        task_data = response.json()
        return task_data
예제 #21
0
    def get_trueskill_scores(self, match_group_id):
        response = self.client.get(self.route.true_skill_score.format(match_group_id))
        raise_if_error("rating", response)

        return response.json()
예제 #22
0
    def get_trueskill_scores(self, match_group_id):
        response = self.client.get(
            self.route.true_skill_score.format(match_group_id))
        raise_if_error("rating", response)

        return response.json()