annofabcli 1.111.2__py3-none-any.whl → 1.113.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- annofabcli/__main__.py +1 -2
- annofabcli/annotation/annotation_query.py +10 -10
- annofabcli/annotation/change_annotation_attributes.py +10 -10
- annofabcli/annotation/change_annotation_attributes_per_annotation.py +4 -5
- annofabcli/annotation/change_annotation_properties.py +14 -14
- annofabcli/annotation/copy_annotation.py +6 -6
- annofabcli/annotation/create_classification_annotation.py +7 -7
- annofabcli/annotation/delete_annotation.py +9 -9
- annofabcli/annotation/download_annotation_zip.py +1 -3
- annofabcli/annotation/dump_annotation.py +8 -8
- annofabcli/annotation/import_annotation.py +13 -13
- annofabcli/annotation/list_annotation.py +9 -9
- annofabcli/annotation/list_annotation_count.py +2 -3
- annofabcli/annotation/merge_segmentation.py +6 -6
- annofabcli/annotation/remove_segmentation_overlap.py +5 -5
- annofabcli/annotation/restore_annotation.py +7 -7
- annofabcli/annotation/subcommand_annotation.py +1 -2
- annofabcli/annotation_specs/add_attribute_restriction.py +4 -5
- annofabcli/annotation_specs/attribute_restriction.py +8 -8
- annofabcli/annotation_specs/export_annotation_specs.py +4 -5
- annofabcli/annotation_specs/get_annotation_specs_with_attribute_id_replaced.py +3 -4
- annofabcli/annotation_specs/get_annotation_specs_with_choice_id_replaced.py +3 -4
- annofabcli/annotation_specs/get_annotation_specs_with_label_id_replaced.py +3 -4
- annofabcli/annotation_specs/list_annotation_specs_attribute.py +9 -10
- annofabcli/annotation_specs/list_annotation_specs_choice.py +9 -10
- annofabcli/annotation_specs/list_annotation_specs_history.py +3 -3
- annofabcli/annotation_specs/list_annotation_specs_label.py +8 -9
- annofabcli/annotation_specs/list_annotation_specs_label_attribute.py +10 -11
- annofabcli/annotation_specs/list_attribute_restriction.py +2 -4
- annofabcli/annotation_specs/list_label_color.py +2 -3
- annofabcli/annotation_specs/put_label_color.py +3 -4
- annofabcli/annotation_specs/subcommand_annotation_specs.py +1 -3
- annofabcli/annotation_zip/list_annotation_3d_bounding_box.py +365 -0
- annofabcli/annotation_zip/list_annotation_bounding_box_2d.py +37 -38
- annofabcli/annotation_zip/list_polygon_annotation.py +390 -0
- annofabcli/annotation_zip/list_polyline_annotation.py +402 -0
- annofabcli/annotation_zip/list_range_annotation.py +25 -15
- annofabcli/annotation_zip/list_single_point_annotation.py +25 -34
- annofabcli/annotation_zip/subcommand_annotation_zip.py +7 -2
- annofabcli/annotation_zip/validate_annotation.py +8 -7
- annofabcli/comment/delete_comment.py +4 -6
- annofabcli/comment/download_comment_json.py +4 -6
- annofabcli/comment/list_all_comment.py +5 -6
- annofabcli/comment/list_comment.py +3 -4
- annofabcli/comment/put_comment.py +9 -10
- annofabcli/comment/put_comment_simply.py +5 -6
- annofabcli/comment/put_inspection_comment.py +1 -3
- annofabcli/comment/put_inspection_comment_simply.py +1 -3
- annofabcli/comment/put_onhold_comment.py +1 -3
- annofabcli/comment/put_onhold_comment_simply.py +1 -3
- annofabcli/comment/subcommand_comment.py +1 -3
- annofabcli/common/bokeh.py +4 -4
- annofabcli/common/cli.py +18 -17
- annofabcli/common/download.py +28 -29
- annofabcli/common/facade.py +37 -38
- annofabcli/common/image.py +14 -14
- annofabcli/common/utils.py +8 -8
- annofabcli/common/visualize.py +13 -13
- annofabcli/experimental/list_out_of_range_annotation_for_movie.py +3 -4
- annofabcli/experimental/subcommand_experimental.py +1 -3
- annofabcli/filesystem/draw_annotation.py +27 -27
- annofabcli/filesystem/filter_annotation.py +9 -10
- annofabcli/filesystem/mask_user_info.py +15 -15
- annofabcli/filesystem/merge_annotation.py +9 -9
- annofabcli/filesystem/subcommand_filesystem.py +1 -3
- annofabcli/input_data/copy_input_data.py +8 -9
- annofabcli/input_data/delete_input_data.py +3 -3
- annofabcli/input_data/delete_metadata_key_of_input_data.py +3 -5
- annofabcli/input_data/download_input_data_json.py +4 -6
- annofabcli/input_data/list_all_input_data.py +9 -9
- annofabcli/input_data/list_all_input_data_merged_task.py +5 -5
- annofabcli/input_data/list_input_data.py +5 -5
- annofabcli/input_data/put_input_data.py +6 -6
- annofabcli/input_data/put_input_data_with_zip.py +3 -4
- annofabcli/input_data/subcommand_input_data.py +1 -3
- annofabcli/input_data/update_input_data.py +6 -8
- annofabcli/input_data/update_metadata_of_input_data.py +3 -5
- annofabcli/instruction/copy_instruction.py +5 -6
- annofabcli/instruction/download_instruction.py +5 -6
- annofabcli/instruction/list_instruction_history.py +3 -3
- annofabcli/instruction/subcommand_instruction.py +1 -3
- annofabcli/instruction/upload_instruction.py +3 -4
- annofabcli/job/delete_job.py +2 -3
- annofabcli/job/list_job.py +5 -5
- annofabcli/job/list_last_job.py +4 -4
- annofabcli/job/subcommand_job.py +1 -3
- annofabcli/job/wait_job.py +4 -5
- annofabcli/my_account/get_my_account.py +2 -3
- annofabcli/my_account/subcommand_my_account.py +1 -3
- annofabcli/organization/list_organization.py +2 -3
- annofabcli/organization/subcommand_organization.py +1 -3
- annofabcli/organization_member/change_organization_member.py +3 -4
- annofabcli/organization_member/delete_organization_member.py +3 -4
- annofabcli/organization_member/invite_organization_member.py +1 -3
- annofabcli/organization_member/list_organization_member.py +3 -3
- annofabcli/organization_member/subcommand_organization_member.py +1 -3
- annofabcli/project/change_organization_of_project.py +4 -4
- annofabcli/project/change_project_status.py +4 -4
- annofabcli/project/copy_project.py +5 -5
- annofabcli/project/create_project.py +8 -8
- annofabcli/project/diff_projects.py +4 -5
- annofabcli/project/list_project.py +5 -5
- annofabcli/project/put_project.py +2 -3
- annofabcli/project/subcommand_project.py +1 -2
- annofabcli/project/update_configuration.py +4 -4
- annofabcli/project/update_project.py +6 -8
- annofabcli/project_member/change_project_members.py +8 -8
- annofabcli/project_member/copy_project_members.py +4 -4
- annofabcli/project_member/drop_project_members.py +2 -3
- annofabcli/project_member/invite_project_members.py +1 -3
- annofabcli/project_member/list_users.py +2 -3
- annofabcli/project_member/put_project_members.py +6 -6
- annofabcli/project_member/subcommand_project_member.py +1 -3
- annofabcli/stat_visualization/mask_visualization_dir.py +8 -9
- annofabcli/stat_visualization/merge_visualization_dir.py +6 -7
- annofabcli/stat_visualization/subcommand_stat_visualization.py +1 -2
- annofabcli/stat_visualization/summarize_whole_performance_csv.py +1 -2
- annofabcli/stat_visualization/write_graph.py +2 -3
- annofabcli/stat_visualization/write_performance_rating_csv.py +20 -27
- annofabcli/statistics/histogram.py +5 -6
- annofabcli/statistics/linegraph.py +13 -14
- annofabcli/statistics/list_annotation_area.py +38 -13
- annofabcli/statistics/list_annotation_attribute.py +9 -10
- annofabcli/statistics/list_annotation_attribute_filled_count.py +30 -31
- annofabcli/statistics/list_annotation_count.py +57 -58
- annofabcli/statistics/list_annotation_duration.py +33 -34
- annofabcli/statistics/list_video_duration.py +4 -5
- annofabcli/statistics/list_worktime.py +4 -4
- annofabcli/statistics/scatter.py +9 -8
- annofabcli/statistics/subcommand_statistics.py +1 -4
- annofabcli/statistics/summarize_task_count.py +4 -6
- annofabcli/statistics/summarize_task_count_by_task_id_group.py +2 -4
- annofabcli/statistics/summarize_task_count_by_user.py +1 -3
- annofabcli/statistics/visualization/dataframe/annotation_count.py +5 -4
- annofabcli/statistics/visualization/dataframe/annotation_duration.py +2 -3
- annofabcli/statistics/visualization/dataframe/cumulative_productivity.py +15 -17
- annofabcli/statistics/visualization/dataframe/productivity_per_date.py +17 -19
- annofabcli/statistics/visualization/dataframe/project_performance.py +3 -12
- annofabcli/statistics/visualization/dataframe/task.py +11 -12
- annofabcli/statistics/visualization/dataframe/task_worktime_by_phase_user.py +9 -10
- annofabcli/statistics/visualization/dataframe/user_performance.py +21 -19
- annofabcli/statistics/visualization/dataframe/whole_performance.py +3 -4
- annofabcli/statistics/visualization/dataframe/whole_productivity_per_date.py +12 -14
- annofabcli/statistics/visualization/dataframe/worktime_per_date.py +11 -13
- annofabcli/statistics/visualization/filtering_query.py +7 -7
- annofabcli/statistics/visualization/project_dir.py +27 -14
- annofabcli/statistics/visualize_annotation_count.py +22 -23
- annofabcli/statistics/visualize_annotation_duration.py +21 -22
- annofabcli/statistics/visualize_statistics.py +36 -33
- annofabcli/statistics/visualize_video_duration.py +18 -20
- annofabcli/supplementary/delete_supplementary_data.py +5 -5
- annofabcli/supplementary/list_supplementary_data.py +4 -4
- annofabcli/supplementary/put_supplementary_data.py +9 -9
- annofabcli/supplementary/subcommand_supplementary.py +1 -3
- annofabcli/task/cancel_acceptance.py +16 -17
- annofabcli/task/change_operator.py +10 -12
- annofabcli/task/change_status_to_break.py +7 -9
- annofabcli/task/change_status_to_on_hold.py +10 -12
- annofabcli/task/complete_tasks.py +17 -18
- annofabcli/task/copy_tasks.py +3 -5
- annofabcli/task/delete_metadata_key_of_task.py +4 -6
- annofabcli/task/delete_tasks.py +7 -7
- annofabcli/task/download_task_json.py +4 -6
- annofabcli/task/list_all_tasks.py +8 -8
- annofabcli/task/list_all_tasks_added_task_history.py +14 -13
- annofabcli/task/list_tasks.py +7 -7
- annofabcli/task/list_tasks_added_task_history.py +10 -10
- annofabcli/task/put_tasks.py +5 -6
- annofabcli/task/put_tasks_by_count.py +2 -3
- annofabcli/task/reject_tasks.py +18 -20
- annofabcli/task/subcommand_task.py +1 -3
- annofabcli/task/update_metadata_of_task.py +5 -6
- annofabcli/task_history/download_task_history_json.py +4 -6
- annofabcli/task_history/list_all_task_history.py +6 -7
- annofabcli/task_history/list_task_history.py +4 -5
- annofabcli/task_history/subcommand_task_history.py +1 -3
- annofabcli/task_history_event/download_task_history_event_json.py +4 -6
- annofabcli/task_history_event/list_all_task_history_event.py +7 -7
- annofabcli/task_history_event/list_worktime.py +17 -16
- annofabcli/task_history_event/subcommand_task_history_event.py +1 -2
- {annofabcli-1.111.2.dist-info → annofabcli-1.113.0.dist-info}/METADATA +9 -15
- annofabcli-1.113.0.dist-info/RECORD +231 -0
- {annofabcli-1.111.2.dist-info → annofabcli-1.113.0.dist-info}/WHEEL +1 -1
- annofabcli-1.111.2.dist-info/RECORD +0 -228
- {annofabcli-1.111.2.dist-info → annofabcli-1.113.0.dist-info}/entry_points.txt +0 -0
- {annofabcli-1.111.2.dist-info → annofabcli-1.113.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,7 +6,7 @@ import multiprocessing
|
|
|
6
6
|
import sys
|
|
7
7
|
import uuid
|
|
8
8
|
from functools import partial
|
|
9
|
-
from typing import Any
|
|
9
|
+
from typing import Any
|
|
10
10
|
|
|
11
11
|
import annofabapi.utils
|
|
12
12
|
import dateutil
|
|
@@ -15,7 +15,6 @@ from annofabapi.dataclass.task import Task
|
|
|
15
15
|
from annofabapi.models import CommentStatus, Inspection, ProjectMemberRole, TaskPhase, TaskStatus
|
|
16
16
|
from more_itertools import first_true
|
|
17
17
|
|
|
18
|
-
import annofabcli
|
|
19
18
|
import annofabcli.common.cli
|
|
20
19
|
from annofabcli.common.cli import (
|
|
21
20
|
COMMAND_LINE_ERROR_STATUS_CODE,
|
|
@@ -196,7 +195,7 @@ class CompleteTasksMain(CommandLineWithConfirm):
|
|
|
196
195
|
def complete_task_for_annotation_phase(
|
|
197
196
|
self,
|
|
198
197
|
task: Task,
|
|
199
|
-
reply_comment:
|
|
198
|
+
reply_comment: str | None = None,
|
|
200
199
|
) -> bool:
|
|
201
200
|
"""
|
|
202
201
|
annotation phaseのタスクを完了状態にする。
|
|
@@ -247,7 +246,7 @@ class CompleteTasksMain(CommandLineWithConfirm):
|
|
|
247
246
|
def complete_task_for_inspection_acceptance_phase(
|
|
248
247
|
self,
|
|
249
248
|
task: Task,
|
|
250
|
-
inspection_status:
|
|
249
|
+
inspection_status: CommentStatus | None = None,
|
|
251
250
|
) -> bool:
|
|
252
251
|
unprocessed_inspection_list_dict: dict[str, list[Inspection]] = {}
|
|
253
252
|
for input_data_id in task.input_data_id_list:
|
|
@@ -286,7 +285,7 @@ class CompleteTasksMain(CommandLineWithConfirm):
|
|
|
286
285
|
return True
|
|
287
286
|
|
|
288
287
|
@staticmethod
|
|
289
|
-
def _validate_task(task: Task, target_phase: TaskPhase, target_phase_stage: int, task_query:
|
|
288
|
+
def _validate_task(task: Task, target_phase: TaskPhase, target_phase_stage: int, task_query: TaskQuery | None) -> bool:
|
|
290
289
|
if not (task.phase == target_phase and task.phase_stage == target_phase_stage):
|
|
291
290
|
logger.warning(f"task_id='{task.task_id}'のタスクは操作対象のフェーズ、フェーズステージではないため、スキップします。")
|
|
292
291
|
return False
|
|
@@ -306,10 +305,10 @@ class CompleteTasksMain(CommandLineWithConfirm):
|
|
|
306
305
|
task_id: str,
|
|
307
306
|
target_phase: TaskPhase,
|
|
308
307
|
target_phase_stage: int,
|
|
309
|
-
reply_comment:
|
|
310
|
-
inspection_status:
|
|
311
|
-
task_query:
|
|
312
|
-
task_index:
|
|
308
|
+
reply_comment: str | None = None,
|
|
309
|
+
inspection_status: CommentStatus | None = None,
|
|
310
|
+
task_query: TaskQuery | None = None,
|
|
311
|
+
task_index: int | None = None,
|
|
313
312
|
) -> bool:
|
|
314
313
|
logging_prefix = f"{task_index + 1} 件目" if task_index is not None else ""
|
|
315
314
|
|
|
@@ -342,9 +341,9 @@ class CompleteTasksMain(CommandLineWithConfirm):
|
|
|
342
341
|
project_id: str,
|
|
343
342
|
target_phase: TaskPhase,
|
|
344
343
|
target_phase_stage: int,
|
|
345
|
-
reply_comment:
|
|
346
|
-
inspection_status:
|
|
347
|
-
task_query:
|
|
344
|
+
reply_comment: str | None = None,
|
|
345
|
+
inspection_status: CommentStatus | None = None,
|
|
346
|
+
task_query: TaskQuery | None = None,
|
|
348
347
|
) -> bool:
|
|
349
348
|
task_index, task_id = tpl
|
|
350
349
|
try:
|
|
@@ -368,10 +367,10 @@ class CompleteTasksMain(CommandLineWithConfirm):
|
|
|
368
367
|
task_id_list: list[str],
|
|
369
368
|
target_phase: TaskPhase,
|
|
370
369
|
target_phase_stage: int,
|
|
371
|
-
reply_comment:
|
|
372
|
-
inspection_status:
|
|
373
|
-
task_query:
|
|
374
|
-
parallelism:
|
|
370
|
+
reply_comment: str | None = None,
|
|
371
|
+
inspection_status: CommentStatus | None = None,
|
|
372
|
+
task_query: TaskQuery | None = None,
|
|
373
|
+
parallelism: int | None = None,
|
|
375
374
|
):
|
|
376
375
|
"""
|
|
377
376
|
検査コメントのstatusを変更(対応完了 or 対応不要)にした上で、タスクを受け入れ完了状態にする
|
|
@@ -465,7 +464,7 @@ class CompleteTasks(CommandLine):
|
|
|
465
464
|
super().validate_project(project_id, [ProjectMemberRole.OWNER, ProjectMemberRole.ACCEPTER])
|
|
466
465
|
|
|
467
466
|
dict_task_query = annofabcli.common.cli.get_json_from_args(args.task_query)
|
|
468
|
-
task_query:
|
|
467
|
+
task_query: TaskQuery | None = TaskQuery.from_dict(dict_task_query) if dict_task_query is not None else None
|
|
469
468
|
|
|
470
469
|
main_obj = CompleteTasksMain(self.service, all_yes=self.all_yes)
|
|
471
470
|
main_obj.complete_task_list(
|
|
@@ -542,7 +541,7 @@ def main(args: argparse.Namespace) -> None:
|
|
|
542
541
|
CompleteTasks(service, facade, args).main()
|
|
543
542
|
|
|
544
543
|
|
|
545
|
-
def add_parser(subparsers:
|
|
544
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
546
545
|
subcommand_name = "complete"
|
|
547
546
|
subcommand_help = "タスクを次のフェーズに進めます。(教師付の提出、検査/受入の合格)"
|
|
548
547
|
description = (
|
annofabcli/task/copy_tasks.py
CHANGED
|
@@ -6,12 +6,10 @@ import logging
|
|
|
6
6
|
import multiprocessing
|
|
7
7
|
import sys
|
|
8
8
|
from dataclasses import dataclass
|
|
9
|
-
from typing import Optional
|
|
10
9
|
|
|
11
10
|
import annofabapi
|
|
12
11
|
from annofabapi.models import ProjectMemberRole
|
|
13
12
|
|
|
14
|
-
import annofabcli
|
|
15
13
|
import annofabcli.common.cli
|
|
16
14
|
from annofabcli.common.cli import (
|
|
17
15
|
COMMAND_LINE_ERROR_STATUS_CODE,
|
|
@@ -74,7 +72,7 @@ class CopyTasksMain(CommandLineWithConfirm):
|
|
|
74
72
|
self.is_copy_annotations = is_copy_annotations
|
|
75
73
|
self.is_copy_metadata = is_copy_metadata
|
|
76
74
|
|
|
77
|
-
def copy_task(self, project_id: str, src_task_id: str, dest_task_id: str, task_index:
|
|
75
|
+
def copy_task(self, project_id: str, src_task_id: str, dest_task_id: str, task_index: int | None = None) -> bool:
|
|
78
76
|
logging_prefix = f"{task_index + 1} 件目" if task_index is not None else ""
|
|
79
77
|
src_task = self.service.wrapper.get_task_or_none(project_id, src_task_id)
|
|
80
78
|
if src_task is None:
|
|
@@ -115,7 +113,7 @@ class CopyTasksMain(CommandLineWithConfirm):
|
|
|
115
113
|
logger.warning(f"タスク'{copy_target.src_task_id}'を'{copy_target.dest_task_id}'にコピーする際に失敗しました。", exc_info=True)
|
|
116
114
|
return False
|
|
117
115
|
|
|
118
|
-
def main(self, project_id: str, copy_target_list: list[CopyTarget], parallelism:
|
|
116
|
+
def main(self, project_id: str, copy_target_list: list[CopyTarget], parallelism: int | None = None) -> None:
|
|
119
117
|
"""
|
|
120
118
|
タスクをコピーします
|
|
121
119
|
|
|
@@ -218,7 +216,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
218
216
|
parser.set_defaults(subcommand_func=main)
|
|
219
217
|
|
|
220
218
|
|
|
221
|
-
def add_parser(subparsers:
|
|
219
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
222
220
|
subcommand_name = "copy"
|
|
223
221
|
subcommand_help = "タスクをコピーします。"
|
|
224
222
|
description = "タスクをコピーします。タスクに含まれるアノテーションはコピーされません。"
|
|
@@ -9,12 +9,10 @@ import sys
|
|
|
9
9
|
from collections.abc import Collection
|
|
10
10
|
from dataclasses import dataclass
|
|
11
11
|
from functools import partial
|
|
12
|
-
from typing import Optional, Union
|
|
13
12
|
|
|
14
13
|
import annofabapi
|
|
15
14
|
from annofabapi.models import ProjectMemberRole
|
|
16
15
|
|
|
17
|
-
import annofabcli
|
|
18
16
|
import annofabcli.common.cli
|
|
19
17
|
from annofabcli.common.cli import (
|
|
20
18
|
COMMAND_LINE_ERROR_STATUS_CODE,
|
|
@@ -28,7 +26,7 @@ from annofabcli.common.facade import AnnofabApiFacade
|
|
|
28
26
|
|
|
29
27
|
logger = logging.getLogger(__name__)
|
|
30
28
|
|
|
31
|
-
Metadata = dict[str,
|
|
29
|
+
Metadata = dict[str, str | bool | int]
|
|
32
30
|
|
|
33
31
|
|
|
34
32
|
@dataclass(frozen=True)
|
|
@@ -43,7 +41,7 @@ class DeleteMetadataKeysOfTaskMain(CommandLineWithConfirm):
|
|
|
43
41
|
service: annofabapi.Resource,
|
|
44
42
|
project_id: str,
|
|
45
43
|
*,
|
|
46
|
-
parallelism:
|
|
44
|
+
parallelism: int | None = None,
|
|
47
45
|
all_yes: bool = False,
|
|
48
46
|
) -> None:
|
|
49
47
|
self.service = service
|
|
@@ -51,7 +49,7 @@ class DeleteMetadataKeysOfTaskMain(CommandLineWithConfirm):
|
|
|
51
49
|
self.parallelism = parallelism
|
|
52
50
|
super().__init__(all_yes=all_yes)
|
|
53
51
|
|
|
54
|
-
def delete_metadata_keys_for_one_task(self, task_id: str, metadata_keys: Collection[str], *, task_index:
|
|
52
|
+
def delete_metadata_keys_for_one_task(self, task_id: str, metadata_keys: Collection[str], *, task_index: int | None = None) -> bool:
|
|
55
53
|
"""
|
|
56
54
|
1個のタスクに対して、メタデータのキーを削除します。
|
|
57
55
|
|
|
@@ -192,7 +190,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
192
190
|
parser.set_defaults(subcommand_func=main)
|
|
193
191
|
|
|
194
192
|
|
|
195
|
-
def add_parser(subparsers:
|
|
193
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
196
194
|
subcommand_name = "delete_metadata_key"
|
|
197
195
|
subcommand_help = "タスクのメタデータのキーを削除します。"
|
|
198
196
|
epilog = "オーナまたはアノテーションユーザロールを持つユーザで実行してください。"
|
annofabcli/task/delete_tasks.py
CHANGED
|
@@ -2,13 +2,13 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import argparse
|
|
4
4
|
import logging
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import Any
|
|
6
6
|
|
|
7
7
|
import annofabapi
|
|
8
8
|
from annofabapi.dataclass.task import Task
|
|
9
9
|
from annofabapi.models import ProjectMemberRole, TaskStatus
|
|
10
10
|
|
|
11
|
-
import annofabcli
|
|
11
|
+
import annofabcli.common.cli
|
|
12
12
|
from annofabcli.common.cli import (
|
|
13
13
|
ArgumentParser,
|
|
14
14
|
CommandLine,
|
|
@@ -110,7 +110,7 @@ class DeleteTaskMain(CommandLineWithConfirm):
|
|
|
110
110
|
self,
|
|
111
111
|
task: dict[str, Any],
|
|
112
112
|
log_prefix: str,
|
|
113
|
-
task_query:
|
|
113
|
+
task_query: TaskQuery | None = None,
|
|
114
114
|
) -> bool:
|
|
115
115
|
"""タスクを削除するかどうかを判定する"""
|
|
116
116
|
|
|
@@ -137,7 +137,7 @@ class DeleteTaskMain(CommandLineWithConfirm):
|
|
|
137
137
|
|
|
138
138
|
return True
|
|
139
139
|
|
|
140
|
-
def delete_task(self, task_id: str, task_query:
|
|
140
|
+
def delete_task(self, task_id: str, task_query: TaskQuery | None = None, task_index: int | None = None) -> bool:
|
|
141
141
|
"""
|
|
142
142
|
タスクを削除します。
|
|
143
143
|
|
|
@@ -200,7 +200,7 @@ class DeleteTaskMain(CommandLineWithConfirm):
|
|
|
200
200
|
def delete_task_list( # noqa: ANN201
|
|
201
201
|
self,
|
|
202
202
|
task_id_list: list[str],
|
|
203
|
-
task_query:
|
|
203
|
+
task_query: TaskQuery | None = None,
|
|
204
204
|
):
|
|
205
205
|
"""
|
|
206
206
|
複数のタスクを削除する。
|
|
@@ -238,7 +238,7 @@ class DeleteTask(CommandLine):
|
|
|
238
238
|
task_id_list = annofabcli.common.cli.get_list_from_args(args.task_id)
|
|
239
239
|
|
|
240
240
|
dict_task_query = annofabcli.common.cli.get_json_from_args(args.task_query)
|
|
241
|
-
task_query:
|
|
241
|
+
task_query: TaskQuery | None = TaskQuery.from_dict(dict_task_query) if dict_task_query is not None else None
|
|
242
242
|
|
|
243
243
|
super().validate_project(args.project_id, [ProjectMemberRole.OWNER])
|
|
244
244
|
|
|
@@ -276,7 +276,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
276
276
|
parser.set_defaults(subcommand_func=main)
|
|
277
277
|
|
|
278
278
|
|
|
279
|
-
def add_parser(subparsers:
|
|
279
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
280
280
|
subcommand_name = "delete"
|
|
281
281
|
subcommand_help = "タスクを削除します。"
|
|
282
282
|
description = "タスクを削除します。ただし、作業中/完了状態のタスクは削除できません。デフォルトは、アノテーションが付与されているタスクは削除できません。"
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import logging
|
|
3
3
|
from pathlib import Path
|
|
4
|
-
from typing import Optional
|
|
5
4
|
|
|
6
5
|
from annofabapi.models import ProjectMemberRole
|
|
7
6
|
|
|
8
|
-
import annofabcli
|
|
9
7
|
import annofabcli.common.cli
|
|
10
8
|
from annofabcli.common.cli import CommandLine, build_annofabapi_resource_and_login
|
|
11
9
|
from annofabcli.common.download import DownloadingFile
|
|
@@ -15,10 +13,10 @@ logger = logging.getLogger(__name__)
|
|
|
15
13
|
|
|
16
14
|
|
|
17
15
|
class DownloadingTaskJson(CommandLine):
|
|
18
|
-
def download_task_json(self, project_id: str, output_file: Path, is_latest: bool)
|
|
16
|
+
def download_task_json(self, project_id: str, output_file: Path, *, is_latest: bool) -> None:
|
|
19
17
|
super().validate_project(project_id, [ProjectMemberRole.OWNER, ProjectMemberRole.TRAINING_DATA_USER])
|
|
20
18
|
project_title = self.facade.get_project_title(project_id)
|
|
21
|
-
logger.info(f"{project_title}
|
|
19
|
+
logger.info(f"project_id='{project_id}'のタスク全件ファイルをダウンロードします。 :: project_id='{project_id}', project_title='{project_title}'")
|
|
22
20
|
|
|
23
21
|
obj = DownloadingFile(self.service)
|
|
24
22
|
obj.download_task_json(
|
|
@@ -26,7 +24,7 @@ class DownloadingTaskJson(CommandLine):
|
|
|
26
24
|
str(output_file),
|
|
27
25
|
is_latest=is_latest,
|
|
28
26
|
)
|
|
29
|
-
logger.info(f"
|
|
27
|
+
logger.info(f"project_id='{project_id}'のタスク全件ファイルをダウンロードしました。 :: output='{output_file}', project_title='{project_title}'")
|
|
30
28
|
|
|
31
29
|
def main(self) -> None:
|
|
32
30
|
args = self.args
|
|
@@ -58,7 +56,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
58
56
|
parser.set_defaults(subcommand_func=main)
|
|
59
57
|
|
|
60
58
|
|
|
61
|
-
def add_parser(subparsers:
|
|
59
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
62
60
|
subcommand_name = "download"
|
|
63
61
|
subcommand_help = "タスク全件ファイルをダウンロードします。"
|
|
64
62
|
description = "タスク全件ファイルをダウンロードします。"
|
|
@@ -3,13 +3,13 @@ import json
|
|
|
3
3
|
import logging
|
|
4
4
|
import tempfile
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import Any
|
|
6
|
+
from typing import Any
|
|
7
7
|
|
|
8
8
|
import annofabapi
|
|
9
9
|
import pandas
|
|
10
10
|
from annofabapi.dataclass.task import Task
|
|
11
11
|
|
|
12
|
-
import annofabcli
|
|
12
|
+
import annofabcli.common.cli
|
|
13
13
|
from annofabcli.common.cli import ArgumentParser, CommandLine, build_annofabapi_resource_and_login
|
|
14
14
|
from annofabcli.common.download import DownloadingFile
|
|
15
15
|
from annofabcli.common.enums import FormatArgument
|
|
@@ -29,8 +29,8 @@ class ListTasksWithJsonMain:
|
|
|
29
29
|
@staticmethod
|
|
30
30
|
def match_task_with_conditions(
|
|
31
31
|
task: dict[str, Any],
|
|
32
|
-
task_id_set:
|
|
33
|
-
task_query:
|
|
32
|
+
task_id_set: set[str] | None = None,
|
|
33
|
+
task_query: TaskQuery | None = None,
|
|
34
34
|
) -> bool:
|
|
35
35
|
result = True
|
|
36
36
|
|
|
@@ -43,9 +43,9 @@ class ListTasksWithJsonMain:
|
|
|
43
43
|
def get_task_list(
|
|
44
44
|
self,
|
|
45
45
|
project_id: str,
|
|
46
|
-
task_json:
|
|
47
|
-
task_id_list:
|
|
48
|
-
task_query:
|
|
46
|
+
task_json: Path | None,
|
|
47
|
+
task_id_list: list[str] | None = None,
|
|
48
|
+
task_query: TaskQuery | None = None,
|
|
49
49
|
is_latest: bool = False, # noqa: FBT001, FBT002
|
|
50
50
|
) -> list[dict[str, Any]]:
|
|
51
51
|
if task_json is None:
|
|
@@ -142,7 +142,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
142
142
|
parser.set_defaults(subcommand_func=main)
|
|
143
143
|
|
|
144
144
|
|
|
145
|
-
def add_parser(subparsers:
|
|
145
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
146
146
|
subcommand_name = "list_all"
|
|
147
147
|
subcommand_help = "すべてのタスクの一覧を出力します。"
|
|
148
148
|
description = "すべてのタスクの一覧を出力します。\n出力されるタスクは、コマンドを実行した日の02:00(JST)頃の状態です。最新の情報を出力したい場合は、 ``--latest`` を指定してください。"
|
|
@@ -6,12 +6,13 @@ import logging
|
|
|
6
6
|
import sys
|
|
7
7
|
import tempfile
|
|
8
8
|
from pathlib import Path
|
|
9
|
-
from typing import Any
|
|
9
|
+
from typing import Any
|
|
10
10
|
|
|
11
11
|
import annofabapi
|
|
12
|
+
import annofabapi.dataclass.task
|
|
12
13
|
from annofabapi.models import ProjectMemberRole, TaskHistory
|
|
13
14
|
|
|
14
|
-
import annofabcli
|
|
15
|
+
import annofabcli.common.cli
|
|
15
16
|
from annofabcli.common.cli import (
|
|
16
17
|
COMMAND_LINE_ERROR_STATUS_CODE,
|
|
17
18
|
ArgumentParser,
|
|
@@ -59,7 +60,7 @@ class ListAllTasksAddedTaskHistoryMain:
|
|
|
59
60
|
|
|
60
61
|
return task_list
|
|
61
62
|
|
|
62
|
-
def load_task_list(self, task_json_path:
|
|
63
|
+
def load_task_list(self, task_json_path: Path | None) -> list[dict[str, Any]]:
|
|
63
64
|
if task_json_path is not None:
|
|
64
65
|
with task_json_path.open(encoding="utf-8") as f:
|
|
65
66
|
return json.load(f)
|
|
@@ -72,7 +73,7 @@ class ListAllTasksAddedTaskHistoryMain:
|
|
|
72
73
|
with task_json_path.open(encoding="utf-8") as f:
|
|
73
74
|
return json.load(f)
|
|
74
75
|
|
|
75
|
-
def load_task_history_dict(self, task_history_json_path:
|
|
76
|
+
def load_task_history_dict(self, task_history_json_path: Path | None) -> TaskHistoryDict:
|
|
76
77
|
if task_history_json_path is not None:
|
|
77
78
|
with task_history_json_path.open(encoding="utf-8") as f:
|
|
78
79
|
return json.load(f)
|
|
@@ -88,8 +89,8 @@ class ListAllTasksAddedTaskHistoryMain:
|
|
|
88
89
|
@staticmethod
|
|
89
90
|
def match_task_with_conditions(
|
|
90
91
|
task: dict[str, Any],
|
|
91
|
-
task_id_set:
|
|
92
|
-
task_query:
|
|
92
|
+
task_id_set: set[str] | None = None,
|
|
93
|
+
task_query: TaskQuery | None = None,
|
|
93
94
|
) -> bool:
|
|
94
95
|
result = True
|
|
95
96
|
|
|
@@ -102,8 +103,8 @@ class ListAllTasksAddedTaskHistoryMain:
|
|
|
102
103
|
def filter_task_list(
|
|
103
104
|
self,
|
|
104
105
|
task_list: list[dict[str, Any]],
|
|
105
|
-
task_id_list:
|
|
106
|
-
task_query:
|
|
106
|
+
task_id_list: list[str] | None = None,
|
|
107
|
+
task_query: TaskQuery | None = None,
|
|
107
108
|
) -> list[dict[str, Any]]:
|
|
108
109
|
if task_query is not None:
|
|
109
110
|
task_query = self.facade.set_account_id_of_task_query(self.project_id, task_query)
|
|
@@ -115,10 +116,10 @@ class ListAllTasksAddedTaskHistoryMain:
|
|
|
115
116
|
|
|
116
117
|
def get_task_list_added_task_history( # noqa: ANN201
|
|
117
118
|
self,
|
|
118
|
-
task_json_path:
|
|
119
|
-
task_history_json_path:
|
|
120
|
-
task_id_list:
|
|
121
|
-
task_query:
|
|
119
|
+
task_json_path: Path | None,
|
|
120
|
+
task_history_json_path: Path | None,
|
|
121
|
+
task_id_list: list[str] | None,
|
|
122
|
+
task_query: TaskQuery | None,
|
|
122
123
|
):
|
|
123
124
|
"""
|
|
124
125
|
タスク履歴情報を加えたタスク一覧を取得する。
|
|
@@ -209,7 +210,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
209
210
|
parser.set_defaults(subcommand_func=main)
|
|
210
211
|
|
|
211
212
|
|
|
212
|
-
def add_parser(subparsers:
|
|
213
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
213
214
|
subcommand_name = "list_all_added_task_history"
|
|
214
215
|
subcommand_help = "タスク履歴に関する情報を加えたタスク一覧のすべてを出力します。"
|
|
215
216
|
description = "タスク履歴に関する情報(フェーズごとの作業時間、担当者、開始日時)を加えたタスク一覧のすべてを出力します。"
|
annofabcli/task/list_tasks.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import logging
|
|
3
|
-
from typing import Any
|
|
3
|
+
from typing import Any
|
|
4
4
|
|
|
5
5
|
import annofabapi
|
|
6
6
|
import pandas
|
|
7
7
|
from annofabapi.models import Task
|
|
8
8
|
|
|
9
|
-
import annofabcli
|
|
9
|
+
import annofabcli.common.cli
|
|
10
10
|
from annofabcli.common.cli import ArgumentParser, CommandLine, build_annofabapi_resource_and_login
|
|
11
11
|
from annofabcli.common.enums import FormatArgument
|
|
12
12
|
from annofabcli.common.facade import AnnofabApiFacade
|
|
@@ -79,7 +79,7 @@ class ListTasksMain:
|
|
|
79
79
|
|
|
80
80
|
return task_query
|
|
81
81
|
|
|
82
|
-
def get_task_list_with_api(self, project_id: str, task_query:
|
|
82
|
+
def get_task_list_with_api(self, project_id: str, task_query: dict[str, Any] | None = None, user_id_list: list[str] | None = None) -> list[Task]:
|
|
83
83
|
"""
|
|
84
84
|
タスク一覧を取得する。
|
|
85
85
|
|
|
@@ -118,9 +118,9 @@ class ListTasksMain:
|
|
|
118
118
|
self,
|
|
119
119
|
project_id: str,
|
|
120
120
|
*,
|
|
121
|
-
task_id_list:
|
|
122
|
-
task_query:
|
|
123
|
-
user_id_list:
|
|
121
|
+
task_id_list: list[str] | None = None,
|
|
122
|
+
task_query: dict[str, Any] | None = None,
|
|
123
|
+
user_id_list: list[str] | None = None,
|
|
124
124
|
) -> list[Task]:
|
|
125
125
|
"""
|
|
126
126
|
|
|
@@ -253,7 +253,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
253
253
|
parser.set_defaults(subcommand_func=main)
|
|
254
254
|
|
|
255
255
|
|
|
256
|
-
def add_parser(subparsers:
|
|
256
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
257
257
|
subcommand_name = "list"
|
|
258
258
|
subcommand_help = "タスク一覧を出力します。"
|
|
259
259
|
description = "タスク一覧を出力します。"
|
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import argparse
|
|
4
4
|
import logging
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import Any
|
|
6
|
+
from typing import Any
|
|
7
7
|
|
|
8
8
|
import annofabapi
|
|
9
9
|
import more_itertools
|
|
@@ -12,7 +12,7 @@ from annofabapi.models import Task, TaskHistory, TaskPhase, TaskStatus
|
|
|
12
12
|
from annofabapi.util.task_history import find_rejected_task_history_indices, get_task_creation_datetime
|
|
13
13
|
from annofabapi.utils import get_task_history_index_skipped_acceptance, get_task_history_index_skipped_inspection
|
|
14
14
|
|
|
15
|
-
import annofabcli
|
|
15
|
+
import annofabcli.common.cli
|
|
16
16
|
from annofabcli.common.cli import ArgumentParser, CommandLine, build_annofabapi_resource_and_login
|
|
17
17
|
from annofabcli.common.enums import FormatArgument
|
|
18
18
|
from annofabcli.common.facade import AnnofabApiFacade
|
|
@@ -89,7 +89,7 @@ def get_post_rejection_acceptance_worktime_hour(task_histories: list[TaskHistory
|
|
|
89
89
|
)
|
|
90
90
|
|
|
91
91
|
|
|
92
|
-
def get_completed_datetime(task: dict[str, Any], task_histories: list[TaskHistory]) ->
|
|
92
|
+
def get_completed_datetime(task: dict[str, Any], task_histories: list[TaskHistory]) -> str | None:
|
|
93
93
|
"""受入完了状態になった日時を取得する。
|
|
94
94
|
|
|
95
95
|
Args:
|
|
@@ -106,7 +106,7 @@ def get_completed_datetime(task: dict[str, Any], task_histories: list[TaskHistor
|
|
|
106
106
|
return None
|
|
107
107
|
|
|
108
108
|
|
|
109
|
-
def get_first_acceptance_completed_datetime(task_histories: list[TaskHistory]) ->
|
|
109
|
+
def get_first_acceptance_completed_datetime(task_histories: list[TaskHistory]) -> str | None:
|
|
110
110
|
"""はじめて受入完了状態になった日時を取得する。
|
|
111
111
|
|
|
112
112
|
Args:
|
|
@@ -135,7 +135,7 @@ def get_first_acceptance_completed_datetime(task_histories: list[TaskHistory]) -
|
|
|
135
135
|
return None
|
|
136
136
|
|
|
137
137
|
|
|
138
|
-
def get_first_acceptance_reached_datetime(task_histories: list[TaskHistory]) ->
|
|
138
|
+
def get_first_acceptance_reached_datetime(task_histories: list[TaskHistory]) -> str | None:
|
|
139
139
|
"""
|
|
140
140
|
はじめて受入フェーズに到達した日時を取得する。
|
|
141
141
|
受入フェーズを着手した日時とは異なる。
|
|
@@ -155,7 +155,7 @@ def get_first_acceptance_reached_datetime(task_histories: list[TaskHistory]) ->
|
|
|
155
155
|
return None
|
|
156
156
|
|
|
157
157
|
|
|
158
|
-
def get_first_inspection_reached_datetime(task_histories: list[TaskHistory]) ->
|
|
158
|
+
def get_first_inspection_reached_datetime(task_histories: list[TaskHistory]) -> str | None:
|
|
159
159
|
"""
|
|
160
160
|
はじめて検査フェーズに到達した日時を取得する。
|
|
161
161
|
検査フェーズを着手した日時とは異なる。
|
|
@@ -213,7 +213,7 @@ def calculate_total_worktime_in_phase(task_histories: list[TaskHistory], phase:
|
|
|
213
213
|
return sum(isoduration_to_hour(history["accumulated_labor_time_milliseconds"]) for history in task_histories if history["phase"] == phase.value)
|
|
214
214
|
|
|
215
215
|
|
|
216
|
-
def get_first_task_history(task_histories: list[TaskHistory], phase: TaskPhase) ->
|
|
216
|
+
def get_first_task_history(task_histories: list[TaskHistory], phase: TaskPhase) -> TaskHistory | None:
|
|
217
217
|
"""
|
|
218
218
|
指定したフェーズの最初に作業したタスク履歴を取得します。
|
|
219
219
|
取得したタスク履歴には、account_idはnot Noneで、作業時間は0より大きいです。
|
|
@@ -263,7 +263,7 @@ class AddingAdditionalInfoToTask:
|
|
|
263
263
|
self.project_id = project_id
|
|
264
264
|
self.visualize = AddProps(self.service, project_id)
|
|
265
265
|
|
|
266
|
-
def _add_task_history_info(self, task: Task, task_history:
|
|
266
|
+
def _add_task_history_info(self, task: Task, task_history: TaskHistory | None, column_prefix: str) -> Task:
|
|
267
267
|
"""
|
|
268
268
|
1個のタスク履歴情報を、タスクに設定する。
|
|
269
269
|
|
|
@@ -375,7 +375,7 @@ class ListTasksAddedTaskHistoryMain:
|
|
|
375
375
|
self.service = service
|
|
376
376
|
self.project_id = project_id
|
|
377
377
|
|
|
378
|
-
def main(self, *, task_query:
|
|
378
|
+
def main(self, *, task_query: dict[str, Any] | None, task_id_list: list[str] | None) -> list[dict[str, Any]]:
|
|
379
379
|
list_task_obj = ListTasksMain(self.service, self.project_id)
|
|
380
380
|
task_list = list_task_obj.get_task_list(self.project_id, task_id_list=task_id_list, task_query=task_query)
|
|
381
381
|
|
|
@@ -526,7 +526,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
526
526
|
parser.set_defaults(subcommand_func=main)
|
|
527
527
|
|
|
528
528
|
|
|
529
|
-
def add_parser(subparsers:
|
|
529
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
530
530
|
subcommand_name = "list_added_task_history"
|
|
531
531
|
subcommand_help = "タスク履歴に関する情報を加えたタスク一覧を出力します。"
|
|
532
532
|
description = "タスク履歴に関する情報(フェーズごとの作業時間、担当者、開始日時)を加えたタスク一覧を出力します。"
|
annofabcli/task/put_tasks.py
CHANGED
|
@@ -8,13 +8,12 @@ import tempfile
|
|
|
8
8
|
from collections import defaultdict
|
|
9
9
|
from enum import Enum
|
|
10
10
|
from pathlib import Path
|
|
11
|
-
from typing import Optional
|
|
12
11
|
|
|
13
12
|
import annofabapi
|
|
14
13
|
import pandas
|
|
15
14
|
from annofabapi.models import JobStatus, ProjectJobType, ProjectMemberRole
|
|
16
15
|
|
|
17
|
-
import annofabcli
|
|
16
|
+
import annofabcli.common.cli
|
|
18
17
|
from annofabcli.common.cli import (
|
|
19
18
|
COMMAND_LINE_ERROR_STATUS_CODE,
|
|
20
19
|
PARALLELISM_CHOICES,
|
|
@@ -54,7 +53,7 @@ def get_task_relation_dict(csv_file: Path) -> TaskInputRelation:
|
|
|
54
53
|
# `dtype=str`を指定した理由:指定しないと、IDが`001`のときに`1`に変換されてしまうため
|
|
55
54
|
df = pandas.read_csv(str(csv_file), header=None, usecols=(0, 1), names=("task_id", "input_data_id"), dtype=str)
|
|
56
55
|
result: TaskInputRelation = defaultdict(list)
|
|
57
|
-
for task_id, input_data_id in zip(df["task_id"], df["input_data_id"]):
|
|
56
|
+
for task_id, input_data_id in zip(df["task_id"], df["input_data_id"], strict=False):
|
|
58
57
|
result[task_id].append(input_data_id)
|
|
59
58
|
return result
|
|
60
59
|
|
|
@@ -88,7 +87,7 @@ class PuttingTaskMain:
|
|
|
88
87
|
service: annofabapi.Resource,
|
|
89
88
|
project_id: str,
|
|
90
89
|
*,
|
|
91
|
-
parallelism:
|
|
90
|
+
parallelism: int | None,
|
|
92
91
|
should_wait: bool = False,
|
|
93
92
|
) -> None:
|
|
94
93
|
self.service = service
|
|
@@ -156,7 +155,7 @@ class PuttingTaskMain:
|
|
|
156
155
|
|
|
157
156
|
def generate_task(
|
|
158
157
|
self,
|
|
159
|
-
api:
|
|
158
|
+
api: ApiWithCreatingTask | None,
|
|
160
159
|
task_relation_dict: TaskInputRelation,
|
|
161
160
|
) -> None:
|
|
162
161
|
"""
|
|
@@ -305,7 +304,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
305
304
|
parser.set_defaults(subcommand_func=main)
|
|
306
305
|
|
|
307
306
|
|
|
308
|
-
def add_parser(subparsers:
|
|
307
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
309
308
|
subcommand_name = "put"
|
|
310
309
|
subcommand_help = "タスクを作成します。"
|
|
311
310
|
description = "タスクを作成します。"
|
|
@@ -3,12 +3,11 @@ from __future__ import annotations
|
|
|
3
3
|
import argparse
|
|
4
4
|
import logging
|
|
5
5
|
from enum import Enum
|
|
6
|
-
from typing import Optional
|
|
7
6
|
|
|
8
7
|
import annofabapi
|
|
9
8
|
from annofabapi.models import JobStatus, ProjectJobType, ProjectMemberRole
|
|
10
9
|
|
|
11
|
-
import annofabcli
|
|
10
|
+
import annofabcli.common.cli
|
|
12
11
|
from annofabcli.common.cli import ArgumentParser, CommandLine, build_annofabapi_resource_and_login
|
|
13
12
|
from annofabcli.common.dataclasses import WaitOptions
|
|
14
13
|
from annofabcli.common.facade import AnnofabApiFacade
|
|
@@ -141,7 +140,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
141
140
|
parser.set_defaults(subcommand_func=main)
|
|
142
141
|
|
|
143
142
|
|
|
144
|
-
def add_parser(subparsers:
|
|
143
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
145
144
|
subcommand_name = "put_by_count"
|
|
146
145
|
subcommand_help = "タスクに割り当てる入力データの個数を指定して、タスクを作成します。"
|
|
147
146
|
epilog = "オーナロールを持つユーザで実行してください。"
|