annofabcli 1.111.1__py3-none-any.whl → 1.112.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 +9 -9
- annofabcli/annotation/change_annotation_attributes_per_annotation.py +3 -4
- annofabcli/annotation/change_annotation_properties.py +13 -13
- annofabcli/annotation/copy_annotation.py +5 -5
- annofabcli/annotation/create_classification_annotation.py +6 -6
- annofabcli/annotation/delete_annotation.py +8 -8
- annofabcli/annotation/download_annotation_zip.py +1 -3
- annofabcli/annotation/dump_annotation.py +7 -7
- annofabcli/annotation/import_annotation.py +12 -12
- annofabcli/annotation/list_annotation.py +8 -8
- annofabcli/annotation/list_annotation_count.py +1 -2
- annofabcli/annotation/merge_segmentation.py +5 -5
- annofabcli/annotation/remove_segmentation_overlap.py +4 -4
- annofabcli/annotation/restore_annotation.py +6 -6
- 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 +2 -2
- 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 +11 -12
- annofabcli/annotation_zip/list_range_annotation.py +24 -14
- annofabcli/annotation_zip/list_single_point_annotation.py +11 -12
- annofabcli/annotation_zip/subcommand_annotation_zip.py +3 -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 +17 -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 +26 -26
- annofabcli/filesystem/filter_annotation.py +9 -10
- annofabcli/filesystem/mask_user_info.py +14 -14
- annofabcli/filesystem/merge_annotation.py +8 -8
- annofabcli/filesystem/subcommand_filesystem.py +1 -3
- annofabcli/input_data/copy_input_data.py +8 -9
- annofabcli/input_data/delete_input_data.py +2 -2
- 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 +8 -8
- annofabcli/input_data/list_all_input_data_merged_task.py +4 -4
- annofabcli/input_data/list_input_data.py +4 -4
- annofabcli/input_data/put_input_data.py +5 -5
- annofabcli/input_data/put_input_data_with_zip.py +2 -3
- 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 +4 -5
- annofabcli/instruction/download_instruction.py +4 -5
- annofabcli/instruction/list_instruction_history.py +2 -2
- annofabcli/instruction/subcommand_instruction.py +1 -3
- annofabcli/instruction/upload_instruction.py +2 -3
- annofabcli/job/delete_job.py +1 -2
- annofabcli/job/list_job.py +4 -4
- annofabcli/job/list_last_job.py +3 -3
- annofabcli/job/subcommand_job.py +1 -3
- annofabcli/job/wait_job.py +4 -5
- annofabcli/my_account/get_my_account.py +1 -2
- annofabcli/my_account/subcommand_my_account.py +1 -3
- annofabcli/organization/list_organization.py +1 -2
- 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 +2 -2
- annofabcli/organization_member/subcommand_organization_member.py +1 -3
- annofabcli/project/change_organization_of_project.py +3 -3
- annofabcli/project/change_project_status.py +3 -3
- annofabcli/project/copy_project.py +4 -4
- annofabcli/project/create_project.py +7 -7
- annofabcli/project/diff_projects.py +4 -5
- annofabcli/project/list_project.py +4 -4
- annofabcli/project/put_project.py +1 -2
- annofabcli/project/subcommand_project.py +1 -2
- annofabcli/project/update_configuration.py +3 -3
- annofabcli/project/update_project.py +6 -8
- annofabcli/project_member/change_project_members.py +7 -7
- annofabcli/project_member/copy_project_members.py +3 -3
- annofabcli/project_member/drop_project_members.py +1 -2
- annofabcli/project_member/invite_project_members.py +1 -3
- annofabcli/project_member/list_users.py +1 -2
- annofabcli/project_member/put_project_members.py +5 -5
- 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 +3 -3
- 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 +6 -7
- 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/visualization/visualization_source_files.py +49 -0
- annofabcli/statistics/visualize_annotation_count.py +22 -23
- annofabcli/statistics/visualize_annotation_duration.py +21 -22
- annofabcli/statistics/visualize_statistics.py +126 -69
- annofabcli/statistics/visualize_video_duration.py +18 -20
- annofabcli/supplementary/delete_supplementary_data.py +4 -4
- annofabcli/supplementary/list_supplementary_data.py +3 -3
- annofabcli/supplementary/put_supplementary_data.py +8 -8
- 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 +6 -6
- annofabcli/task/download_task_json.py +4 -6
- annofabcli/task/list_all_tasks.py +7 -7
- annofabcli/task/list_all_tasks_added_task_history.py +12 -12
- annofabcli/task/list_tasks.py +6 -6
- annofabcli/task/list_tasks_added_task_history.py +9 -9
- annofabcli/task/put_tasks.py +4 -5
- annofabcli/task/put_tasks_by_count.py +1 -2
- 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 +5 -6
- annofabcli/task_history/list_task_history.py +3 -4
- 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 +6 -6
- annofabcli/task_history_event/list_worktime.py +15 -15
- annofabcli/task_history_event/subcommand_task_history_event.py +1 -2
- {annofabcli-1.111.1.dist-info → annofabcli-1.112.0.dist-info}/METADATA +9 -15
- annofabcli-1.112.0.dist-info/RECORD +229 -0
- {annofabcli-1.111.1.dist-info → annofabcli-1.112.0.dist-info}/WHEEL +1 -1
- annofabcli-1.111.1.dist-info/RECORD +0 -228
- {annofabcli-1.111.1.dist-info → annofabcli-1.112.0.dist-info}/entry_points.txt +0 -0
- {annofabcli-1.111.1.dist-info → annofabcli-1.112.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,7 +6,7 @@ import multiprocessing
|
|
|
6
6
|
import sys
|
|
7
7
|
from dataclasses import dataclass
|
|
8
8
|
from functools import partial
|
|
9
|
-
from typing import Any
|
|
9
|
+
from typing import Any
|
|
10
10
|
|
|
11
11
|
import annofabapi
|
|
12
12
|
import more_itertools
|
|
@@ -14,7 +14,6 @@ import requests
|
|
|
14
14
|
from annofabapi.dataclass.task import Task
|
|
15
15
|
from annofabapi.models import ProjectMemberRole, TaskPhase, TaskStatus
|
|
16
16
|
|
|
17
|
-
import annofabcli
|
|
18
17
|
import annofabcli.common.cli
|
|
19
18
|
from annofabcli.common.cli import (
|
|
20
19
|
COMMAND_LINE_ERROR_STATUS_CODE,
|
|
@@ -43,12 +42,12 @@ class CancelAcceptanceMain(CommandLineWithConfirm):
|
|
|
43
42
|
self.project_id = project_id
|
|
44
43
|
self.facade = AnnofabApiFacade(service)
|
|
45
44
|
|
|
46
|
-
self._project_members_dict:
|
|
45
|
+
self._project_members_dict: dict[str, dict[str, Any]] | None = None
|
|
47
46
|
"""プロジェクトメンバー情報を保持する変数"""
|
|
48
47
|
|
|
49
48
|
CommandLineWithConfirm.__init__(self, all_yes)
|
|
50
49
|
|
|
51
|
-
def get_project_member_from_account_id(self, account_id: str) ->
|
|
50
|
+
def get_project_member_from_account_id(self, account_id: str) -> dict[str, Any] | None:
|
|
52
51
|
"""account_idからプロジェクトメンバを取得します。"""
|
|
53
52
|
if self._project_members_dict is None:
|
|
54
53
|
project_member_list = self.service.wrapper.get_all_project_members(self.project_id)
|
|
@@ -59,10 +58,10 @@ class CancelAcceptanceMain(CommandLineWithConfirm):
|
|
|
59
58
|
def cancel_acceptance_for_task(
|
|
60
59
|
self,
|
|
61
60
|
task_id: str,
|
|
62
|
-
acceptor:
|
|
61
|
+
acceptor: User | None = None,
|
|
63
62
|
assign_last_acceptor: bool = True, # noqa: FBT001, FBT002
|
|
64
|
-
task_query:
|
|
65
|
-
task_index:
|
|
63
|
+
task_query: TaskQuery | None = None,
|
|
64
|
+
task_index: int | None = None,
|
|
66
65
|
dryrun: bool = False, # noqa: FBT001, FBT002
|
|
67
66
|
) -> bool:
|
|
68
67
|
logging_prefix = f"{task_index + 1} 件目" if task_index is not None else ""
|
|
@@ -77,7 +76,7 @@ class CancelAcceptanceMain(CommandLineWithConfirm):
|
|
|
77
76
|
logger.warning(f"{logging_prefix}: task_id = {task_id} は受入完了でありません。status = {task['status']}, phase={task['phase']}")
|
|
78
77
|
return False
|
|
79
78
|
|
|
80
|
-
actual_acceptor:
|
|
79
|
+
actual_acceptor: User | None = None
|
|
81
80
|
if assign_last_acceptor:
|
|
82
81
|
# 最後の受入フェーズの担当者の情報を取得する
|
|
83
82
|
acceptor_account_id = task["account_id"]
|
|
@@ -119,9 +118,9 @@ class CancelAcceptanceMain(CommandLineWithConfirm):
|
|
|
119
118
|
def cancel_acceptance_for_wrapper(
|
|
120
119
|
self,
|
|
121
120
|
tpl: tuple[int, str],
|
|
122
|
-
acceptor:
|
|
121
|
+
acceptor: User | None = None,
|
|
123
122
|
assign_last_acceptor: bool = True, # noqa: FBT001, FBT002
|
|
124
|
-
task_query:
|
|
123
|
+
task_query: TaskQuery | None = None,
|
|
125
124
|
dryrun: bool = False, # noqa: FBT001, FBT002
|
|
126
125
|
) -> bool:
|
|
127
126
|
task_index, task_id = tpl
|
|
@@ -141,10 +140,10 @@ class CancelAcceptanceMain(CommandLineWithConfirm):
|
|
|
141
140
|
def cancel_acceptance_for_task_list( # noqa: ANN201
|
|
142
141
|
self,
|
|
143
142
|
task_id_list: list[str],
|
|
144
|
-
acceptor:
|
|
143
|
+
acceptor: User | None = None,
|
|
145
144
|
assign_last_acceptor: bool = True, # noqa: FBT001, FBT002
|
|
146
|
-
task_query:
|
|
147
|
-
parallelism:
|
|
145
|
+
task_query: TaskQuery | None = None,
|
|
146
|
+
parallelism: int | None = None,
|
|
148
147
|
dryrun: bool = False, # noqa: FBT001, FBT002
|
|
149
148
|
):
|
|
150
149
|
"""
|
|
@@ -221,13 +220,13 @@ class CancelAcceptance(CommandLine):
|
|
|
221
220
|
|
|
222
221
|
task_id_list = annofabcli.common.cli.get_list_from_args(args.task_id)
|
|
223
222
|
|
|
224
|
-
assigned_acceptor_user_id:
|
|
223
|
+
assigned_acceptor_user_id: str | None = args.assigned_acceptor_user_id
|
|
225
224
|
|
|
226
225
|
# 最後の受入フェーズの担当者に割り当てるか否か
|
|
227
226
|
assign_last_acceptor = not args.not_assign and assigned_acceptor_user_id is None
|
|
228
227
|
|
|
229
228
|
# 受入担当者の情報を取得する
|
|
230
|
-
acceptor:
|
|
229
|
+
acceptor: User | None = None # 受入担当者
|
|
231
230
|
if assigned_acceptor_user_id is not None:
|
|
232
231
|
project_member_list = self.service.wrapper.get_all_project_members(args.project_id)
|
|
233
232
|
member = more_itertools.first_true(project_member_list, pred=lambda e: e["user_id"] == assigned_acceptor_user_id)
|
|
@@ -241,7 +240,7 @@ class CancelAcceptance(CommandLine):
|
|
|
241
240
|
acceptor = User(account_id=member["account_id"], user_id=member["user_id"], username=member["username"])
|
|
242
241
|
|
|
243
242
|
dict_task_query = annofabcli.common.cli.get_json_from_args(args.task_query)
|
|
244
|
-
task_query:
|
|
243
|
+
task_query: TaskQuery | None = TaskQuery.from_dict(dict_task_query) if dict_task_query is not None else None
|
|
245
244
|
|
|
246
245
|
super().validate_project(args.project_id, [ProjectMemberRole.OWNER])
|
|
247
246
|
main_obj = CancelAcceptanceMain(self.service, project_id=args.project_id, all_yes=args.yes)
|
|
@@ -304,7 +303,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
304
303
|
parser.set_defaults(subcommand_func=main)
|
|
305
304
|
|
|
306
305
|
|
|
307
|
-
def add_parser(subparsers:
|
|
306
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
308
307
|
subcommand_name = "cancel_acceptance"
|
|
309
308
|
subcommand_help = "受入が完了したタスクに対して、受入を取り消します。"
|
|
310
309
|
description = "受入が完了したタスクに対して、受入を取り消します。"
|
|
@@ -3,14 +3,12 @@ import logging
|
|
|
3
3
|
import multiprocessing
|
|
4
4
|
import sys
|
|
5
5
|
from functools import partial
|
|
6
|
-
from typing import Optional
|
|
7
6
|
|
|
8
7
|
import annofabapi
|
|
9
8
|
import requests
|
|
10
9
|
from annofabapi.dataclass.task import Task
|
|
11
10
|
from annofabapi.models import ProjectMemberRole, TaskStatus
|
|
12
11
|
|
|
13
|
-
import annofabcli
|
|
14
12
|
import annofabcli.common.cli
|
|
15
13
|
from annofabcli.common.cli import (
|
|
16
14
|
COMMAND_LINE_ERROR_STATUS_CODE,
|
|
@@ -63,9 +61,9 @@ class ChangeOperatorMain:
|
|
|
63
61
|
self,
|
|
64
62
|
project_id: str,
|
|
65
63
|
task_id: str,
|
|
66
|
-
new_account_id:
|
|
67
|
-
task_query:
|
|
68
|
-
task_index:
|
|
64
|
+
new_account_id: str | None = None,
|
|
65
|
+
task_query: TaskQuery | None = None,
|
|
66
|
+
task_index: int | None = None,
|
|
69
67
|
) -> bool:
|
|
70
68
|
logging_prefix = f"{task_index + 1} 件目" if task_index is not None else ""
|
|
71
69
|
dict_task = self.service.wrapper.get_task_or_none(project_id, task_id)
|
|
@@ -115,8 +113,8 @@ class ChangeOperatorMain:
|
|
|
115
113
|
self,
|
|
116
114
|
tpl: tuple[int, str],
|
|
117
115
|
project_id: str,
|
|
118
|
-
task_query:
|
|
119
|
-
new_account_id:
|
|
116
|
+
task_query: TaskQuery | None = None,
|
|
117
|
+
new_account_id: str | None = None,
|
|
120
118
|
) -> bool:
|
|
121
119
|
task_index, task_id = tpl
|
|
122
120
|
try:
|
|
@@ -136,9 +134,9 @@ class ChangeOperatorMain:
|
|
|
136
134
|
project_id: str,
|
|
137
135
|
task_id_list: list[str],
|
|
138
136
|
*,
|
|
139
|
-
new_user_id:
|
|
140
|
-
task_query:
|
|
141
|
-
parallelism:
|
|
137
|
+
new_user_id: str | None = None,
|
|
138
|
+
task_query: TaskQuery | None = None,
|
|
139
|
+
parallelism: int | None = None,
|
|
142
140
|
) -> None:
|
|
143
141
|
"""
|
|
144
142
|
指定した複数のタスクの担当者を変更します。
|
|
@@ -219,7 +217,7 @@ class ChangeOperator(CommandLine):
|
|
|
219
217
|
return
|
|
220
218
|
|
|
221
219
|
dict_task_query = annofabcli.common.cli.get_json_from_args(args.task_query)
|
|
222
|
-
task_query:
|
|
220
|
+
task_query: TaskQuery | None = TaskQuery.from_dict(dict_task_query) if dict_task_query is not None else None
|
|
223
221
|
|
|
224
222
|
project_id = args.project_id
|
|
225
223
|
super().validate_project(project_id, [ProjectMemberRole.OWNER, ProjectMemberRole.ACCEPTER])
|
|
@@ -270,7 +268,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
270
268
|
parser.set_defaults(subcommand_func=main)
|
|
271
269
|
|
|
272
270
|
|
|
273
|
-
def add_parser(subparsers:
|
|
271
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
274
272
|
subcommand_name = "change_operator"
|
|
275
273
|
subcommand_help = "タスクの担当者を変更します。"
|
|
276
274
|
description = "タスクの担当者を変更します。作業中状態、完了状態のタスクは、担当者を変更できません。保留中状態のタスクは、デフォルトでは担当者を変更できません。"
|
|
@@ -3,14 +3,12 @@ import logging
|
|
|
3
3
|
import multiprocessing
|
|
4
4
|
import sys
|
|
5
5
|
from functools import partial
|
|
6
|
-
from typing import Optional
|
|
7
6
|
|
|
8
7
|
import annofabapi
|
|
9
8
|
import requests
|
|
10
9
|
from annofabapi.dataclass.task import Task
|
|
11
10
|
from annofabapi.models import ProjectMemberRole, TaskStatus
|
|
12
11
|
|
|
13
|
-
import annofabcli
|
|
14
12
|
import annofabcli.common.cli
|
|
15
13
|
from annofabcli.common.cli import (
|
|
16
14
|
COMMAND_LINE_ERROR_STATUS_CODE,
|
|
@@ -39,8 +37,8 @@ class ChangeStatusToBreakMain(CommandLineWithConfirm):
|
|
|
39
37
|
self,
|
|
40
38
|
project_id: str,
|
|
41
39
|
task_id: str,
|
|
42
|
-
task_index:
|
|
43
|
-
task_query:
|
|
40
|
+
task_index: int | None = None,
|
|
41
|
+
task_query: TaskQuery | None = None,
|
|
44
42
|
) -> bool:
|
|
45
43
|
logging_prefix = f"{task_index + 1} 件目" if task_index is not None else ""
|
|
46
44
|
dict_task = self.service.wrapper.get_task_or_none(project_id, task_id)
|
|
@@ -79,7 +77,7 @@ class ChangeStatusToBreakMain(CommandLineWithConfirm):
|
|
|
79
77
|
self,
|
|
80
78
|
tpl: tuple[int, str],
|
|
81
79
|
project_id: str,
|
|
82
|
-
task_query:
|
|
80
|
+
task_query: TaskQuery | None = None,
|
|
83
81
|
) -> bool:
|
|
84
82
|
task_index, task_id = tpl
|
|
85
83
|
try:
|
|
@@ -97,8 +95,8 @@ class ChangeStatusToBreakMain(CommandLineWithConfirm):
|
|
|
97
95
|
self,
|
|
98
96
|
project_id: str,
|
|
99
97
|
task_id_list: list[str],
|
|
100
|
-
task_query:
|
|
101
|
-
parallelism:
|
|
98
|
+
task_query: TaskQuery | None = None,
|
|
99
|
+
parallelism: int | None = None,
|
|
102
100
|
):
|
|
103
101
|
"""
|
|
104
102
|
タスクのステータスを休憩中に変更する。
|
|
@@ -172,7 +170,7 @@ class ChangeStatusToBreak(CommandLine):
|
|
|
172
170
|
task_id_list = annofabcli.common.cli.get_list_from_args(args.task_id)
|
|
173
171
|
|
|
174
172
|
dict_task_query = annofabcli.common.cli.get_json_from_args(args.task_query)
|
|
175
|
-
task_query:
|
|
173
|
+
task_query: TaskQuery | None = TaskQuery.from_dict(dict_task_query) if dict_task_query is not None else None
|
|
176
174
|
|
|
177
175
|
project_id = args.project_id
|
|
178
176
|
super().validate_project(project_id, [ProjectMemberRole.OWNER, ProjectMemberRole.ACCEPTER, ProjectMemberRole.WORKER])
|
|
@@ -210,7 +208,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
210
208
|
parser.set_defaults(subcommand_func=main)
|
|
211
209
|
|
|
212
210
|
|
|
213
|
-
def add_parser(subparsers:
|
|
211
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
214
212
|
subcommand_name = "change_status_to_break"
|
|
215
213
|
subcommand_help = "タスクのステータスを休憩中に変更します。"
|
|
216
214
|
description = "タスクのステータスを休憩中に変更します。ただし、操作対象のタスクは作業中か保留中である必要があります。"
|
|
@@ -6,14 +6,12 @@ import multiprocessing
|
|
|
6
6
|
import sys
|
|
7
7
|
import uuid
|
|
8
8
|
from functools import partial
|
|
9
|
-
from typing import Optional
|
|
10
9
|
|
|
11
10
|
import annofabapi
|
|
12
11
|
import requests
|
|
13
12
|
from annofabapi.dataclass.task import Task
|
|
14
13
|
from annofabapi.models import ProjectMemberRole, TaskStatus
|
|
15
14
|
|
|
16
|
-
import annofabcli
|
|
17
15
|
import annofabcli.common.cli
|
|
18
16
|
from annofabcli.common.cli import (
|
|
19
17
|
COMMAND_LINE_ERROR_STATUS_CODE,
|
|
@@ -68,9 +66,9 @@ class ChangingStatusToOnHoldMain(CommandLineWithConfirm):
|
|
|
68
66
|
self,
|
|
69
67
|
task_id: str,
|
|
70
68
|
*,
|
|
71
|
-
comment:
|
|
72
|
-
task_index:
|
|
73
|
-
task_query:
|
|
69
|
+
comment: str | None = None,
|
|
70
|
+
task_index: int | None = None,
|
|
71
|
+
task_query: TaskQuery | None = None,
|
|
74
72
|
) -> bool:
|
|
75
73
|
"""
|
|
76
74
|
Args:
|
|
@@ -155,8 +153,8 @@ class ChangingStatusToOnHoldMain(CommandLineWithConfirm):
|
|
|
155
153
|
self,
|
|
156
154
|
tpl: tuple[int, str],
|
|
157
155
|
*,
|
|
158
|
-
comment:
|
|
159
|
-
task_query:
|
|
156
|
+
comment: str | None = None,
|
|
157
|
+
task_query: TaskQuery | None = None,
|
|
160
158
|
) -> bool:
|
|
161
159
|
task_index, task_id = tpl
|
|
162
160
|
try:
|
|
@@ -174,9 +172,9 @@ class ChangingStatusToOnHoldMain(CommandLineWithConfirm):
|
|
|
174
172
|
self,
|
|
175
173
|
task_id_list: list[str],
|
|
176
174
|
*,
|
|
177
|
-
comment:
|
|
178
|
-
task_query:
|
|
179
|
-
parallelism:
|
|
175
|
+
comment: str | None = None,
|
|
176
|
+
task_query: TaskQuery | None = None,
|
|
177
|
+
parallelism: int | None = None,
|
|
180
178
|
):
|
|
181
179
|
"""
|
|
182
180
|
タスクのステータスを保留中に変更する。
|
|
@@ -246,7 +244,7 @@ class ChangingStatusToOnHold(CommandLine):
|
|
|
246
244
|
task_id_list = annofabcli.common.cli.get_list_from_args(args.task_id)
|
|
247
245
|
|
|
248
246
|
dict_task_query = annofabcli.common.cli.get_json_from_args(args.task_query)
|
|
249
|
-
task_query:
|
|
247
|
+
task_query: TaskQuery | None = TaskQuery.from_dict(dict_task_query) if dict_task_query is not None else None
|
|
250
248
|
|
|
251
249
|
project_id = args.project_id
|
|
252
250
|
super().validate_project(project_id, [ProjectMemberRole.OWNER, ProjectMemberRole.ACCEPTER, ProjectMemberRole.WORKER])
|
|
@@ -286,7 +284,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
286
284
|
parser.set_defaults(subcommand_func=main)
|
|
287
285
|
|
|
288
286
|
|
|
289
|
-
def add_parser(subparsers:
|
|
287
|
+
def add_parser(subparsers: argparse._SubParsersAction | None = None) -> argparse.ArgumentParser:
|
|
290
288
|
subcommand_name = "change_status_to_on_hold"
|
|
291
289
|
subcommand_help = "タスクのステータスを保留に変更します。"
|
|
292
290
|
description = "タスクのステータスを保留に変更します。ただし、操作対象のタスクのステータスは休憩中か未着手である必要があります。"
|
|
@@ -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,7 +2,7 @@ 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
|
|
@@ -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,7 +3,7 @@ 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
|
|
@@ -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`` を指定してください。"
|