annofabcli 1.102.1__py3-none-any.whl → 1.103.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/annotation/annotation_query.py +9 -29
- annofabcli/annotation/change_annotation_attributes.py +6 -14
- annofabcli/annotation/change_annotation_properties.py +5 -12
- annofabcli/annotation/copy_annotation.py +4 -10
- annofabcli/annotation/delete_annotation.py +10 -26
- annofabcli/annotation/dump_annotation.py +1 -4
- annofabcli/annotation/import_annotation.py +16 -40
- annofabcli/annotation/list_annotation.py +1 -4
- annofabcli/annotation/merge_segmentation.py +5 -15
- annofabcli/annotation/remove_segmentation_overlap.py +8 -29
- annofabcli/annotation/restore_annotation.py +3 -9
- annofabcli/annotation_specs/add_attribute_restriction.py +2 -8
- annofabcli/annotation_specs/attribute_restriction.py +2 -10
- annofabcli/annotation_specs/export_annotation_specs.py +1 -3
- annofabcli/annotation_specs/get_annotation_specs_with_attribute_id_replaced.py +3 -10
- annofabcli/annotation_specs/get_annotation_specs_with_choice_id_replaced.py +4 -10
- annofabcli/annotation_specs/get_annotation_specs_with_label_id_replaced.py +1 -3
- annofabcli/annotation_specs/list_annotation_specs_attribute.py +7 -18
- annofabcli/annotation_specs/list_annotation_specs_choice.py +3 -8
- annofabcli/annotation_specs/list_annotation_specs_history.py +0 -1
- annofabcli/annotation_specs/list_annotation_specs_label.py +3 -8
- annofabcli/annotation_specs/list_annotation_specs_label_attribute.py +4 -9
- annofabcli/annotation_specs/list_attribute_restriction.py +3 -9
- annofabcli/annotation_specs/put_label_color.py +1 -6
- annofabcli/comment/delete_comment.py +3 -9
- annofabcli/comment/list_all_comment.py +2 -4
- annofabcli/comment/list_comment.py +1 -4
- annofabcli/comment/put_comment.py +4 -13
- annofabcli/comment/put_comment_simply.py +2 -6
- annofabcli/comment/put_inspection_comment.py +2 -6
- annofabcli/comment/put_inspection_comment_simply.py +3 -6
- annofabcli/comment/put_onhold_comment.py +2 -6
- annofabcli/comment/put_onhold_comment_simply.py +2 -4
- annofabcli/common/cli.py +5 -43
- annofabcli/common/download.py +8 -25
- annofabcli/common/image.py +5 -9
- annofabcli/common/utils.py +1 -3
- annofabcli/common/visualize.py +2 -4
- annofabcli/filesystem/draw_annotation.py +8 -20
- annofabcli/filesystem/filter_annotation.py +7 -24
- annofabcli/filesystem/mask_user_info.py +3 -6
- annofabcli/filesystem/merge_annotation.py +2 -6
- annofabcli/input_data/change_input_data_name.py +3 -7
- annofabcli/input_data/copy_input_data.py +6 -14
- annofabcli/input_data/delete_input_data.py +7 -24
- annofabcli/input_data/delete_metadata_key_of_input_data.py +5 -16
- annofabcli/input_data/list_all_input_data.py +5 -14
- annofabcli/input_data/list_all_input_data_merged_task.py +8 -23
- annofabcli/input_data/list_input_data.py +5 -16
- annofabcli/input_data/put_input_data.py +7 -19
- annofabcli/input_data/update_metadata_of_input_data.py +6 -14
- annofabcli/instruction/list_instruction_history.py +0 -1
- annofabcli/instruction/upload_instruction.py +1 -4
- annofabcli/job/list_job.py +1 -2
- annofabcli/job/list_last_job.py +1 -3
- annofabcli/organization/list_organization.py +0 -1
- annofabcli/organization_member/change_organization_member.py +1 -3
- annofabcli/organization_member/delete_organization_member.py +2 -6
- annofabcli/organization_member/invite_organization_member.py +1 -3
- annofabcli/organization_member/list_organization_member.py +0 -1
- annofabcli/project/change_organization_of_project.py +257 -0
- annofabcli/project/change_project_status.py +2 -2
- annofabcli/project/copy_project.py +2 -7
- annofabcli/project/diff_projects.py +4 -16
- annofabcli/project/list_project.py +0 -1
- annofabcli/project/put_project.py +2 -6
- annofabcli/project/subcommand_project.py +2 -0
- annofabcli/project_member/change_project_members.py +2 -2
- annofabcli/project_member/copy_project_members.py +2 -7
- annofabcli/project_member/drop_project_members.py +1 -3
- annofabcli/project_member/invite_project_members.py +1 -3
- annofabcli/project_member/list_users.py +0 -1
- annofabcli/project_member/put_project_members.py +4 -12
- annofabcli/stat_visualization/mask_visualization_dir.py +6 -16
- annofabcli/stat_visualization/merge_visualization_dir.py +6 -18
- annofabcli/stat_visualization/summarize_whole_performance_csv.py +3 -7
- annofabcli/stat_visualization/write_graph.py +5 -15
- annofabcli/stat_visualization/write_performance_rating_csv.py +4 -12
- annofabcli/statistics/list_annotation_area.py +3 -7
- annofabcli/statistics/list_annotation_attribute.py +6 -15
- annofabcli/statistics/list_annotation_attribute_filled_count.py +9 -23
- annofabcli/statistics/list_annotation_count.py +18 -44
- annofabcli/statistics/list_annotation_duration.py +14 -40
- annofabcli/statistics/list_video_duration.py +2 -3
- annofabcli/statistics/list_worktime.py +0 -1
- annofabcli/statistics/scatter.py +3 -9
- annofabcli/statistics/summarize_task_count.py +7 -12
- annofabcli/statistics/summarize_task_count_by_task_id_group.py +3 -11
- annofabcli/statistics/summarize_task_count_by_user.py +1 -5
- annofabcli/statistics/visualization/dataframe/annotation_count.py +1 -3
- annofabcli/statistics/visualization/dataframe/cumulative_productivity.py +3 -9
- annofabcli/statistics/visualization/dataframe/productivity_per_date.py +11 -23
- annofabcli/statistics/visualization/dataframe/project_performance.py +1 -3
- annofabcli/statistics/visualization/dataframe/task.py +2 -5
- annofabcli/statistics/visualization/dataframe/task_worktime_by_phase_user.py +6 -20
- annofabcli/statistics/visualization/dataframe/user_performance.py +29 -88
- annofabcli/statistics/visualization/dataframe/whole_performance.py +4 -10
- annofabcli/statistics/visualization/dataframe/whole_productivity_per_date.py +17 -49
- annofabcli/statistics/visualization/dataframe/worktime_per_date.py +3 -9
- annofabcli/statistics/visualization/filtering_query.py +2 -6
- annofabcli/statistics/visualization/project_dir.py +9 -26
- annofabcli/statistics/visualization/visualization_source_files.py +3 -10
- annofabcli/statistics/visualize_annotation_count.py +7 -21
- annofabcli/statistics/visualize_annotation_duration.py +7 -17
- annofabcli/statistics/visualize_statistics.py +17 -52
- annofabcli/statistics/visualize_video_duration.py +8 -19
- annofabcli/supplementary/delete_supplementary_data.py +7 -23
- annofabcli/supplementary/list_supplementary_data.py +1 -1
- annofabcli/supplementary/put_supplementary_data.py +5 -15
- annofabcli/task/cancel_acceptance.py +3 -4
- annofabcli/task/change_operator.py +3 -11
- annofabcli/task/change_status_to_break.py +1 -1
- annofabcli/task/change_status_to_on_hold.py +5 -18
- annofabcli/task/complete_tasks.py +8 -25
- annofabcli/task/copy_tasks.py +2 -3
- annofabcli/task/delete_metadata_key_of_task.py +2 -6
- annofabcli/task/delete_tasks.py +7 -25
- annofabcli/task/list_all_tasks.py +2 -4
- annofabcli/task/list_tasks.py +2 -6
- annofabcli/task/list_tasks_added_task_history.py +7 -21
- annofabcli/task/put_tasks.py +2 -3
- annofabcli/task/put_tasks_by_count.py +3 -7
- annofabcli/task/reject_tasks.py +7 -19
- annofabcli/task/update_metadata_of_task.py +1 -1
- annofabcli/task_history/list_all_task_history.py +2 -5
- annofabcli/task_history/list_task_history.py +0 -1
- annofabcli/task_history_event/list_all_task_history_event.py +4 -11
- annofabcli/task_history_event/list_worktime.py +4 -14
- {annofabcli-1.102.1.dist-info → annofabcli-1.103.0.dist-info}/METADATA +1 -1
- annofabcli-1.103.0.dist-info/RECORD +215 -0
- annofabcli-1.102.1.dist-info/RECORD +0 -214
- {annofabcli-1.102.1.dist-info → annofabcli-1.103.0.dist-info}/WHEEL +0 -0
- {annofabcli-1.102.1.dist-info → annofabcli-1.103.0.dist-info}/entry_points.txt +0 -0
- {annofabcli-1.102.1.dist-info → annofabcli-1.103.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -77,9 +77,7 @@ class CopyInputDataMain(CommandLineWithConfirm):
|
|
|
77
77
|
dest_supplementary_data_list,
|
|
78
78
|
pred=lambda e, s=src_supplementary_data: e["supplementary_data_id"] == s["supplementary_data_id"], # type: ignore[misc]
|
|
79
79
|
)
|
|
80
|
-
last_updated_datetime_for_supplementary_data =
|
|
81
|
-
dest_supplementary_data["updated_datetime"] if dest_supplementary_data is not None else None
|
|
82
|
-
)
|
|
80
|
+
last_updated_datetime_for_supplementary_data = dest_supplementary_data["updated_datetime"] if dest_supplementary_data is not None else None
|
|
83
81
|
self.copy_supplementary_data(src_supplementary_data, last_updated_datetime=last_updated_datetime_for_supplementary_data)
|
|
84
82
|
logger.debug(
|
|
85
83
|
f"{logging_prefix}補助情報をコピーしました。 :: "
|
|
@@ -169,9 +167,7 @@ class CopyInputDataMain(CommandLineWithConfirm):
|
|
|
169
167
|
)
|
|
170
168
|
except Exception:
|
|
171
169
|
logger.warning(
|
|
172
|
-
f"入力データのコピーに失敗しました。 :: "
|
|
173
|
-
f"input_data_id='{input_data_id}', "
|
|
174
|
-
f"src_project_id='{self.src_project_id}', dest_project_id='{self.dest_project_id}'",
|
|
170
|
+
f"入力データのコピーに失敗しました。 :: input_data_id='{input_data_id}', src_project_id='{self.src_project_id}', dest_project_id='{self.dest_project_id}'",
|
|
175
171
|
exc_info=True,
|
|
176
172
|
)
|
|
177
173
|
return False
|
|
@@ -213,15 +209,12 @@ class CopyInputDataMain(CommandLineWithConfirm):
|
|
|
213
209
|
success_count += 1
|
|
214
210
|
except Exception:
|
|
215
211
|
logger.warning(
|
|
216
|
-
f"入力データのコピーに失敗しました。 :: "
|
|
217
|
-
f"input_data_id='{input_data_id}', "
|
|
218
|
-
f"src_project_id='{self.src_project_id}', dest_project_id='{self.dest_project_id}'",
|
|
212
|
+
f"入力データのコピーに失敗しました。 :: input_data_id='{input_data_id}', src_project_id='{self.src_project_id}', dest_project_id='{self.dest_project_id}'",
|
|
219
213
|
exc_info=True,
|
|
220
214
|
)
|
|
221
215
|
|
|
222
216
|
logger.info(
|
|
223
|
-
f"{success_count} / {len(input_data_id_list)} 件の入力データと関連する補助情報をコピーしました。 :: "
|
|
224
|
-
f"src_project_id='{self.src_project_id}', dest_project_id='{self.dest_project_id}'"
|
|
217
|
+
f"{success_count} / {len(input_data_id_list)} 件の入力データと関連する補助情報をコピーしました。 :: src_project_id='{self.src_project_id}', dest_project_id='{self.dest_project_id}'"
|
|
225
218
|
)
|
|
226
219
|
|
|
227
220
|
|
|
@@ -286,8 +279,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
286
279
|
type=str,
|
|
287
280
|
nargs="+",
|
|
288
281
|
required=False,
|
|
289
|
-
help="コピー対象の入力データのinput_data_idを指定します。 "
|
|
290
|
-
"``file://`` を先頭に付けると、input_data_idの一覧が記載されたファイルを指定できます。",
|
|
282
|
+
help="コピー対象の入力データのinput_data_idを指定します。 ``file://`` を先頭に付けると、input_data_idの一覧が記載されたファイルを指定できます。",
|
|
291
283
|
)
|
|
292
284
|
|
|
293
285
|
parser.add_argument(
|
|
@@ -300,7 +292,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
300
292
|
"--parallelism",
|
|
301
293
|
type=int,
|
|
302
294
|
choices=PARALLELISM_CHOICES,
|
|
303
|
-
help="使用するプロセス数(並列度)を指定してください。指定する場合は必ず ``--yes`` を指定してください。指定しない場合は、逐次的に処理します。",
|
|
295
|
+
help="使用するプロセス数(並列度)を指定してください。指定する場合は必ず ``--yes`` を指定してください。指定しない場合は、逐次的に処理します。",
|
|
304
296
|
)
|
|
305
297
|
|
|
306
298
|
parser.set_defaults(subcommand_func=main)
|
|
@@ -17,9 +17,7 @@ class DeleteInputData(CommandLine):
|
|
|
17
17
|
入力データを削除する。
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
-
def delete_supplementary_data_list_for_input_data(
|
|
21
|
-
self, project_id: str, input_data_id: str, supplementary_data_list: list[dict[str, Any]]
|
|
22
|
-
) -> int:
|
|
20
|
+
def delete_supplementary_data_list_for_input_data(self, project_id: str, input_data_id: str, supplementary_data_list: list[dict[str, Any]]) -> int:
|
|
23
21
|
"""
|
|
24
22
|
入力データ配下の補助情報を削除する。
|
|
25
23
|
|
|
@@ -59,11 +57,7 @@ class DeleteInputData(CommandLine):
|
|
|
59
57
|
return self.confirm_processing(message_for_confirm)
|
|
60
58
|
|
|
61
59
|
def confirm_delete_supplementary(self, input_data_id: str, input_data_name: str, supplementary_data_list: list[dict[str, Any]]) -> bool:
|
|
62
|
-
message_for_confirm = (
|
|
63
|
-
f"入力データに紐づく補助情報 {len(supplementary_data_list)} 件を削除しますか? "
|
|
64
|
-
f"(input_data_id='{input_data_id}', "
|
|
65
|
-
f"input_data_name='{input_data_name}') "
|
|
66
|
-
)
|
|
60
|
+
message_for_confirm = f"入力データに紐づく補助情報 {len(supplementary_data_list)} 件を削除しますか? (input_data_id='{input_data_id}', input_data_name='{input_data_name}') "
|
|
67
61
|
return self.confirm_processing(message_for_confirm)
|
|
68
62
|
|
|
69
63
|
def delete_input_data(self, project_id: str, input_data_id: str, input_data_index: int, delete_supplementary: bool, force: bool): # noqa: ANN201, FBT001
|
|
@@ -86,28 +80,18 @@ class DeleteInputData(CommandLine):
|
|
|
86
80
|
)
|
|
87
81
|
return False
|
|
88
82
|
else:
|
|
89
|
-
logger.debug(
|
|
90
|
-
f"入力データ(input_data_id='{input_data_id}', "
|
|
91
|
-
f"input_data_name='{input_data_name}')はタスクに使われています。"
|
|
92
|
-
f"task_id_list='{used_task_id_list}'"
|
|
93
|
-
)
|
|
83
|
+
logger.debug(f"入力データ(input_data_id='{input_data_id}', input_data_name='{input_data_name}')はタスクに使われています。task_id_list='{used_task_id_list}'")
|
|
94
84
|
|
|
95
85
|
if not self.confirm_delete_input_data(input_data_id, input_data_name, used_task_id_list=used_task_id_list):
|
|
96
86
|
return False
|
|
97
87
|
|
|
98
88
|
self.service.api.delete_input_data(project_id, input_data_id)
|
|
99
|
-
logger.debug(
|
|
100
|
-
f"{input_data_index + 1!s} 件目: 入力データ(input_data_id='{input_data_id}', input_data_name='{input_data_name}') を削除しました。"
|
|
101
|
-
)
|
|
89
|
+
logger.debug(f"{input_data_index + 1!s} 件目: 入力データ(input_data_id='{input_data_id}', input_data_name='{input_data_name}') を削除しました。")
|
|
102
90
|
|
|
103
91
|
if delete_supplementary:
|
|
104
92
|
supplementary_data_list, _ = self.service.api.get_supplementary_data_list(project_id, input_data_id)
|
|
105
|
-
if len(supplementary_data_list) > 0 and self.confirm_delete_supplementary(
|
|
106
|
-
|
|
107
|
-
):
|
|
108
|
-
deleted_supplementary_data = self.delete_supplementary_data_list_for_input_data(
|
|
109
|
-
project_id, input_data_id, supplementary_data_list=supplementary_data_list
|
|
110
|
-
)
|
|
93
|
+
if len(supplementary_data_list) > 0 and self.confirm_delete_supplementary(input_data_id, input_data_name, supplementary_data_list=supplementary_data_list):
|
|
94
|
+
deleted_supplementary_data = self.delete_supplementary_data_list_for_input_data(project_id, input_data_id, supplementary_data_list=supplementary_data_list)
|
|
111
95
|
logger.debug(
|
|
112
96
|
f"{input_data_index + 1!s} 件目: 入力データ(input_data_id='{input_data_id}', "
|
|
113
97
|
f"input_data_name='{input_data_name}') に紐づく補助情報を"
|
|
@@ -170,8 +154,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
170
154
|
type=str,
|
|
171
155
|
required=True,
|
|
172
156
|
nargs="+",
|
|
173
|
-
help="削除対象の入力データのinput_data_idを指定します。"
|
|
174
|
-
" ``file://`` を先頭に付けると、input_data_idの一覧が記載されたファイルを指定できます。",
|
|
157
|
+
help="削除対象の入力データのinput_data_idを指定します。 ``file://`` を先頭に付けると、input_data_idの一覧が記載されたファイルを指定できます。",
|
|
175
158
|
)
|
|
176
159
|
|
|
177
160
|
parser.add_argument("--force", action="store_true", help="タスクに使われている入力データも削除します。")
|
|
@@ -40,9 +40,7 @@ class DeleteMetadataKeyOfInputDataMain(CommandLineWithConfirm):
|
|
|
40
40
|
self.project_id = project_id
|
|
41
41
|
super().__init__(all_yes=all_yes)
|
|
42
42
|
|
|
43
|
-
def delete_metadata_keys_for_one_input_data(
|
|
44
|
-
self, input_data_id: str, metadata_keys: Collection[str], *, input_data_index: Optional[int] = None
|
|
45
|
-
) -> bool:
|
|
43
|
+
def delete_metadata_keys_for_one_input_data(self, input_data_id: str, metadata_keys: Collection[str], *, input_data_index: Optional[int] = None) -> bool:
|
|
46
44
|
"""
|
|
47
45
|
1個の入力データに対して、メタデータのキーを削除します。
|
|
48
46
|
|
|
@@ -63,10 +61,7 @@ class DeleteMetadataKeyOfInputDataMain(CommandLineWithConfirm):
|
|
|
63
61
|
input_data_name = input_data["input_data_name"]
|
|
64
62
|
str_old_metadata = json.dumps(old_metadata)
|
|
65
63
|
deleted_keys = set(metadata_keys) & set(old_metadata.keys()) # 削除可能な(存在する)メタデータのキー
|
|
66
|
-
logger.debug(
|
|
67
|
-
f"{logging_prefix} input_data_id='{input_data_id}', input_data_name='{input_data_name}', metadata='{str_old_metadata}' :: "
|
|
68
|
-
f"削除対象のキーが {len(deleted_keys)} 件存在します。"
|
|
69
|
-
)
|
|
64
|
+
logger.debug(f"{logging_prefix} input_data_id='{input_data_id}', input_data_name='{input_data_name}', metadata='{str_old_metadata}' :: 削除対象のキーが {len(deleted_keys)} 件存在します。")
|
|
70
65
|
|
|
71
66
|
if len(deleted_keys) == 0:
|
|
72
67
|
# メタデータを更新する必要がないのでreturnします。
|
|
@@ -77,8 +72,7 @@ class DeleteMetadataKeyOfInputDataMain(CommandLineWithConfirm):
|
|
|
77
72
|
new_metadata.pop(key, None)
|
|
78
73
|
|
|
79
74
|
if not self.all_yes and not self.confirm_processing(
|
|
80
|
-
f"input_data_id='{input_data_id}', input_data_name='{input_data_name}'"
|
|
81
|
-
f" :: metadata='{str_old_metadata}' からキー'{deleted_keys}'を削除しますか?"
|
|
75
|
+
f"input_data_id='{input_data_id}', input_data_name='{input_data_name}' :: metadata='{str_old_metadata}' からキー'{deleted_keys}'を削除しますか?"
|
|
82
76
|
):
|
|
83
77
|
return False
|
|
84
78
|
|
|
@@ -91,10 +85,7 @@ class DeleteMetadataKeyOfInputDataMain(CommandLineWithConfirm):
|
|
|
91
85
|
|
|
92
86
|
self.service.api.put_input_data(self.project_id, input_data_id, request_body=input_data)
|
|
93
87
|
str_new_metadata = json.dumps(new_metadata)
|
|
94
|
-
logger.debug(
|
|
95
|
-
f"{logging_prefix} input_data_id='{input_data_id}' :: 入力データのメタデータからキー'{deleted_keys}'を削除しました。"
|
|
96
|
-
f" :: metadata='{str_new_metadata}'"
|
|
97
|
-
)
|
|
88
|
+
logger.debug(f"{logging_prefix} input_data_id='{input_data_id}' :: 入力データのメタデータからキー'{deleted_keys}'を削除しました。 :: metadata='{str_new_metadata}'")
|
|
98
89
|
return True
|
|
99
90
|
|
|
100
91
|
def delete_metadata_keys_for_one_input_data_wrapper(self, tpl: tuple[int, str], metadata_keys: Collection[str]) -> bool:
|
|
@@ -109,9 +100,7 @@ class DeleteMetadataKeyOfInputDataMain(CommandLineWithConfirm):
|
|
|
109
100
|
logger.warning(f"input_data_id='{input_data_id}' :: 入力データのメタデータのキーを削除するのに失敗しました。", exc_info=True)
|
|
110
101
|
return False
|
|
111
102
|
|
|
112
|
-
def delete_metadata_keys_for_input_data_list(
|
|
113
|
-
self, input_data_id_list: list[str], metadata_keys: Collection[str], *, parallelism: Optional[int] = None
|
|
114
|
-
) -> None:
|
|
103
|
+
def delete_metadata_keys_for_input_data_list(self, input_data_id_list: list[str], metadata_keys: Collection[str], *, parallelism: Optional[int] = None) -> None:
|
|
115
104
|
logger.info(f"{len(input_data_id_list)} 件の入力データのメタデータから、キー'{metadata_keys}'を削除します。")
|
|
116
105
|
|
|
117
106
|
success_count = 0
|
|
@@ -91,9 +91,7 @@ class ListInputDataWithJsonMain:
|
|
|
91
91
|
input_data_list = json.load(f)
|
|
92
92
|
|
|
93
93
|
input_data_id_set = set(input_data_id_list) if input_data_id_list is not None else None
|
|
94
|
-
filtered_input_data_list = [
|
|
95
|
-
e for e in input_data_list if self.filter_input_data_list(e, input_data_query=input_data_query, input_data_id_set=input_data_id_set)
|
|
96
|
-
]
|
|
94
|
+
filtered_input_data_list = [e for e in input_data_list if self.filter_input_data_list(e, input_data_query=input_data_query, input_data_id_set=input_data_id_set)]
|
|
97
95
|
|
|
98
96
|
adding_obj = AddingDetailsToInputData(self.service, project_id)
|
|
99
97
|
if contain_parent_task_id_list:
|
|
@@ -113,9 +111,7 @@ class ListAllInputData(CommandLine):
|
|
|
113
111
|
args = self.args
|
|
114
112
|
|
|
115
113
|
input_data_id_list = annofabcli.common.cli.get_list_from_args(args.input_data_id) if args.input_data_id is not None else None
|
|
116
|
-
input_data_query = (
|
|
117
|
-
InputDataQuery.from_dict(annofabcli.common.cli.get_json_from_args(args.input_data_query)) if args.input_data_query is not None else None
|
|
118
|
-
)
|
|
114
|
+
input_data_query = InputDataQuery.from_dict(annofabcli.common.cli.get_json_from_args(args.input_data_query)) if args.input_data_query is not None else None
|
|
119
115
|
|
|
120
116
|
project_id = args.project_id
|
|
121
117
|
super().validate_project(project_id, project_member_roles=[ProjectMemberRole.TRAINING_DATA_USER, ProjectMemberRole.OWNER])
|
|
@@ -195,13 +191,9 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
195
191
|
"指定しない場合は、コマンドを実行した日の02:00(JST)頃の入力データの一覧が出力されます。",
|
|
196
192
|
)
|
|
197
193
|
|
|
198
|
-
parser.add_argument(
|
|
199
|
-
"--with_parent_task_id_list", action="store_true", help="入力データを参照しているタスクのIDのlist( ``parent_task_id_list`` )も出力します。"
|
|
200
|
-
)
|
|
194
|
+
parser.add_argument("--with_parent_task_id_list", action="store_true", help="入力データを参照しているタスクのIDのlist( ``parent_task_id_list`` )も出力します。")
|
|
201
195
|
|
|
202
|
-
parser.add_argument(
|
|
203
|
-
"--with_supplementary_data_count", action="store_true", help="入力データに紐づく補助情報の個数( ``supplementary_data_count`` )も出力します。"
|
|
204
|
-
)
|
|
196
|
+
parser.add_argument("--with_supplementary_data_count", action="store_true", help="入力データに紐づく補助情報の個数( ``supplementary_data_count`` )も出力します。")
|
|
205
197
|
|
|
206
198
|
argument_parser.add_format(
|
|
207
199
|
choices=[
|
|
@@ -213,7 +205,6 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
213
205
|
default=FormatArgument.CSV,
|
|
214
206
|
)
|
|
215
207
|
argument_parser.add_output()
|
|
216
|
-
argument_parser.add_csv_format()
|
|
217
208
|
|
|
218
209
|
parser.set_defaults(subcommand_func=main)
|
|
219
210
|
|
|
@@ -221,7 +212,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
221
212
|
def add_parser(subparsers: Optional[argparse._SubParsersAction] = None) -> argparse.ArgumentParser:
|
|
222
213
|
subcommand_name = "list_all"
|
|
223
214
|
subcommand_help = "すべての入力データの一覧を出力します。"
|
|
224
|
-
description = "すべての入力データの一覧を出力します。\n出力される入力データは、コマンドを実行した日の02:00(JST)頃の状態です。最新の情報を出力したい場合は、 ``--latest`` を指定してください。"
|
|
215
|
+
description = "すべての入力データの一覧を出力します。\n出力される入力データは、コマンドを実行した日の02:00(JST)頃の状態です。最新の情報を出力したい場合は、 ``--latest`` を指定してください。"
|
|
225
216
|
epilog = "アノテーションユーザまたはオーナロールを持つユーザで実行してください。"
|
|
226
217
|
|
|
227
218
|
parser = annofabcli.common.cli.add_parser(subparsers, subcommand_name, subcommand_help, description, epilog=epilog)
|
|
@@ -180,21 +180,13 @@ class ListInputDataMergedTask(CommandLine):
|
|
|
180
180
|
input_data_list = json.load(f)
|
|
181
181
|
|
|
182
182
|
input_data_id_set = set(get_list_from_args(args.input_data_id)) if args.input_data_id is not None else None
|
|
183
|
-
input_data_query = (
|
|
184
|
-
|
|
185
|
-
)
|
|
186
|
-
filtered_input_data_list = [
|
|
187
|
-
e for e in input_data_list if match_input_data(e, input_data_query=input_data_query, input_data_id_set=input_data_id_set)
|
|
188
|
-
]
|
|
183
|
+
input_data_query = InputDataQuery.from_dict(annofabcli.common.cli.get_json_from_args(args.input_data_query)) if args.input_data_query is not None else None
|
|
184
|
+
filtered_input_data_list = [e for e in input_data_list if match_input_data(e, input_data_query=input_data_query, input_data_id_set=input_data_id_set)]
|
|
189
185
|
|
|
190
186
|
input_data_list_with_merged_task = create_input_data_list_with_merged_task(input_data_list=filtered_input_data_list, task_list=task_list)
|
|
191
187
|
|
|
192
188
|
filtered_input_data_list_with_merged_task = [
|
|
193
|
-
e
|
|
194
|
-
for e in input_data_list_with_merged_task
|
|
195
|
-
if match_parent_task_list_of_input_data_with(
|
|
196
|
-
e, is_not_used_by_task=args.not_used_by_task, is_used_by_multiple_task=args.used_by_multiple_task
|
|
197
|
-
)
|
|
189
|
+
e for e in input_data_list_with_merged_task if match_parent_task_list_of_input_data_with(e, is_not_used_by_task=args.not_used_by_task, is_used_by_multiple_task=args.used_by_multiple_task)
|
|
198
190
|
]
|
|
199
191
|
|
|
200
192
|
logger.debug(f"入力データ {len(filtered_input_data_list_with_merged_task)} 件を出力します。")
|
|
@@ -224,9 +216,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
224
216
|
)
|
|
225
217
|
|
|
226
218
|
parser.add_argument("-i", "--input_data_id", type=str, nargs="+", help="指定したinput_data_idに完全一致する入力データを絞り込みます。")
|
|
227
|
-
parser.add_argument(
|
|
228
|
-
"--input_data_name", type=str, nargs="+", help="指定したinput_data_nameに部分一致(大文字小文字区別しない)する入力データを絞り込みます。"
|
|
229
|
-
)
|
|
219
|
+
parser.add_argument("--input_data_name", type=str, nargs="+", help="指定したinput_data_nameに部分一致(大文字小文字区別しない)する入力データを絞り込みます。")
|
|
230
220
|
|
|
231
221
|
parser.add_argument(
|
|
232
222
|
"-iq",
|
|
@@ -242,8 +232,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
242
232
|
used_by_task_group.add_argument(
|
|
243
233
|
"--not_used_by_task",
|
|
244
234
|
action="store_true",
|
|
245
|
-
help="タスクから使われていない入力データのみ出力します。\n"
|
|
246
|
-
"「入力データは登録したがタスクは登録していなかった」などのデータ登録のミスを探すときに利用できます。",
|
|
235
|
+
help="タスクから使われていない入力データのみ出力します。\n「入力データは登録したがタスクは登録していなかった」などのデータ登録のミスを探すときに利用できます。",
|
|
247
236
|
)
|
|
248
237
|
|
|
249
238
|
used_by_task_group.add_argument(
|
|
@@ -256,22 +245,19 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
256
245
|
parser.add_argument(
|
|
257
246
|
"--input_data_json",
|
|
258
247
|
type=str,
|
|
259
|
-
help="入力データ情報が記載されたJSONファイルのパスを指定してください。JSONに記載された情報を元に出力します。"
|
|
260
|
-
"JSONファイルは ``$ annofabcli input_data download`` コマンドで取得できます。",
|
|
248
|
+
help="入力データ情報が記載されたJSONファイルのパスを指定してください。JSONに記載された情報を元に出力します。JSONファイルは ``$ annofabcli input_data download`` コマンドで取得できます。",
|
|
261
249
|
)
|
|
262
250
|
|
|
263
251
|
parser.add_argument(
|
|
264
252
|
"--task_json",
|
|
265
253
|
type=str,
|
|
266
|
-
help="タスク情報が記載されたJSONファイルのパスを指定してください。JSONに記載された情報を元に出力します。"
|
|
267
|
-
"JSONファイルは ``$ annofabcli task download`` コマンドで取得できます。",
|
|
254
|
+
help="タスク情報が記載されたJSONファイルのパスを指定してください。JSONに記載された情報を元に出力します。JSONファイルは ``$ annofabcli task download`` コマンドで取得できます。",
|
|
268
255
|
)
|
|
269
256
|
|
|
270
257
|
parser.add_argument(
|
|
271
258
|
"--latest",
|
|
272
259
|
action="store_true",
|
|
273
|
-
help="入力データ一覧ファイル、タスク一覧ファイルの更新が完了するまで待って、最新のファイルをダウンロードします。"
|
|
274
|
-
" ``--project_id`` を指定したときのみ有効です。",
|
|
260
|
+
help="入力データ一覧ファイル、タスク一覧ファイルの更新が完了するまで待って、最新のファイルをダウンロードします。 ``--project_id`` を指定したときのみ有効です。",
|
|
275
261
|
)
|
|
276
262
|
|
|
277
263
|
argument_parser.add_format(
|
|
@@ -283,7 +269,6 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
283
269
|
default=FormatArgument.CSV,
|
|
284
270
|
)
|
|
285
271
|
argument_parser.add_output()
|
|
286
|
-
argument_parser.add_csv_format()
|
|
287
272
|
|
|
288
273
|
parser.set_defaults(subcommand_func=main)
|
|
289
274
|
|
|
@@ -25,9 +25,7 @@ class AddingDetailsToInputData:
|
|
|
25
25
|
self.service = service
|
|
26
26
|
self.project_id = project_id
|
|
27
27
|
|
|
28
|
-
def add_parent_task_id_list_to_input_data_list(
|
|
29
|
-
self, input_data_list: list[InputData], *, average_input_data_id_length: int = 36
|
|
30
|
-
) -> list[InputData]:
|
|
28
|
+
def add_parent_task_id_list_to_input_data_list(self, input_data_list: list[InputData], *, average_input_data_id_length: int = 36) -> list[InputData]:
|
|
31
29
|
"""
|
|
32
30
|
`input_data_list`に"どのタスクに使われているか"という情報を付与します。
|
|
33
31
|
|
|
@@ -58,10 +56,7 @@ class AddingDetailsToInputData:
|
|
|
58
56
|
if len(encoded_input_data_id_list) > MAX_URL_QUERY_LENGTH:
|
|
59
57
|
differential_length = len(encoded_input_data_id_list) - MAX_URL_QUERY_LENGTH
|
|
60
58
|
decreasing_size = (differential_length // average_input_data_id_length) + 1
|
|
61
|
-
logger.debug(
|
|
62
|
-
f"chunk_sizeを {chunk_size} から、{chunk_size - decreasing_size} に減らした. "
|
|
63
|
-
f"len(encoded_input_data_id_list) = {len(encoded_input_data_id_list)}"
|
|
64
|
-
)
|
|
59
|
+
logger.debug(f"chunk_sizeを {chunk_size} から、{chunk_size - decreasing_size} に減らした. len(encoded_input_data_id_list) = {len(encoded_input_data_id_list)}")
|
|
65
60
|
chunk_size = chunk_size - decreasing_size
|
|
66
61
|
if chunk_size <= 0:
|
|
67
62
|
chunk_size = 1
|
|
@@ -219,17 +214,12 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
219
214
|
"--input_data_id",
|
|
220
215
|
type=str,
|
|
221
216
|
nargs="+",
|
|
222
|
-
help="対象のinput_data_idを指定します。 ``--input_data_query`` 引数とは同時に指定できません。"
|
|
223
|
-
" ``file://`` を先頭に付けると、input_data_idの一覧が記載されたファイルを指定できます。",
|
|
217
|
+
help="対象のinput_data_idを指定します。 ``--input_data_query`` 引数とは同時に指定できません。 ``file://`` を先頭に付けると、input_data_idの一覧が記載されたファイルを指定できます。",
|
|
224
218
|
)
|
|
225
219
|
|
|
226
|
-
parser.add_argument(
|
|
227
|
-
"--with_parent_task_id_list", action="store_true", help="入力データを参照しているタスクのIDのlist( ``parent_task_id_list`` )も出力します。"
|
|
228
|
-
)
|
|
220
|
+
parser.add_argument("--with_parent_task_id_list", action="store_true", help="入力データを参照しているタスクのIDのlist( ``parent_task_id_list`` )も出力します。")
|
|
229
221
|
|
|
230
|
-
parser.add_argument(
|
|
231
|
-
"--with_supplementary_data_count", action="store_true", help="入力データに紐づく補助情報の個数( ``supplementary_data_count`` )も出力します。"
|
|
232
|
-
)
|
|
222
|
+
parser.add_argument("--with_supplementary_data_count", action="store_true", help="入力データに紐づく補助情報の個数( ``supplementary_data_count`` )も出力します。")
|
|
233
223
|
|
|
234
224
|
argument_parser.add_format(
|
|
235
225
|
choices=[
|
|
@@ -241,7 +231,6 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
241
231
|
default=FormatArgument.CSV,
|
|
242
232
|
)
|
|
243
233
|
argument_parser.add_output()
|
|
244
|
-
argument_parser.add_csv_format()
|
|
245
234
|
|
|
246
235
|
parser.set_defaults(subcommand_func=main)
|
|
247
236
|
|
|
@@ -136,9 +136,7 @@ class SubPutInputData:
|
|
|
136
136
|
if file_path is not None:
|
|
137
137
|
request_body.update({"input_data_name": csv_input_data.input_data_name})
|
|
138
138
|
logger.debug(f"'{file_path}'を入力データとして登録します。input_data_name='{csv_input_data.input_data_name}'")
|
|
139
|
-
self.service.wrapper.put_input_data_from_file(
|
|
140
|
-
project_id, input_data_id=csv_input_data.input_data_id, file_path=file_path, request_body=request_body
|
|
141
|
-
)
|
|
139
|
+
self.service.wrapper.put_input_data_from_file(project_id, input_data_id=csv_input_data.input_data_id, file_path=file_path, request_body=request_body)
|
|
142
140
|
|
|
143
141
|
else:
|
|
144
142
|
request_body.update(
|
|
@@ -174,17 +172,11 @@ class SubPutInputData:
|
|
|
174
172
|
return yes
|
|
175
173
|
|
|
176
174
|
def confirm_put_input_data(self, input_data: InputDataForPut, already_exists: bool = False) -> bool: # noqa: FBT001, FBT002
|
|
177
|
-
message_for_confirm =
|
|
178
|
-
f"input_data_name='{input_data.input_data_name}', input_data_id='{input_data.input_data_id}' の入力データを登録しますか?"
|
|
179
|
-
)
|
|
175
|
+
message_for_confirm = f"input_data_name='{input_data.input_data_name}', input_data_id='{input_data.input_data_id}' の入力データを登録しますか?"
|
|
180
176
|
if already_exists:
|
|
181
|
-
message_for_confirm =
|
|
182
|
-
f"input_data_name='{input_data.input_data_name}', input_data_id='{input_data.input_data_id}' の入力データを上書きして登録しますか?"
|
|
183
|
-
)
|
|
177
|
+
message_for_confirm = f"input_data_name='{input_data.input_data_name}', input_data_id='{input_data.input_data_id}' の入力データを上書きして登録しますか?"
|
|
184
178
|
else:
|
|
185
|
-
message_for_confirm =
|
|
186
|
-
f"input_data_name='{input_data.input_data_name}', input_data_id='{input_data.input_data_id}' の入力データを登録しますか?"
|
|
187
|
-
)
|
|
179
|
+
message_for_confirm = f"input_data_name='{input_data.input_data_name}', input_data_id='{input_data.input_data_id}' の入力データを登録しますか?"
|
|
188
180
|
|
|
189
181
|
return self.confirm_processing(message_for_confirm)
|
|
190
182
|
|
|
@@ -192,9 +184,7 @@ class SubPutInputData:
|
|
|
192
184
|
input_data = InputDataForPut(
|
|
193
185
|
input_data_name=csv_input_data.input_data_name,
|
|
194
186
|
input_data_path=csv_input_data.input_data_path,
|
|
195
|
-
input_data_id=csv_input_data.input_data_id
|
|
196
|
-
if csv_input_data.input_data_id is not None
|
|
197
|
-
else convert_input_data_name_to_input_data_id(csv_input_data.input_data_name),
|
|
187
|
+
input_data_id=csv_input_data.input_data_id if csv_input_data.input_data_id is not None else convert_input_data_name_to_input_data_id(csv_input_data.input_data_name),
|
|
198
188
|
)
|
|
199
189
|
|
|
200
190
|
last_updated_datetime = None
|
|
@@ -231,9 +221,7 @@ class SubPutInputData:
|
|
|
231
221
|
return False
|
|
232
222
|
except CheckSumError:
|
|
233
223
|
logger.warning(
|
|
234
|
-
f"入力データを登録しましたが、データが破損している可能性があります。"
|
|
235
|
-
f"input_data_id='{input_data.input_data_id}', "
|
|
236
|
-
f"input_data_name='{input_data.input_data_name}',",
|
|
224
|
+
f"入力データを登録しましたが、データが破損している可能性があります。input_data_id='{input_data.input_data_id}', input_data_name='{input_data.input_data_name}',",
|
|
237
225
|
exc_info=True,
|
|
238
226
|
)
|
|
239
227
|
return False
|
|
@@ -345,7 +333,7 @@ class PutInputData(CommandLine):
|
|
|
345
333
|
is_duplicated = is_duplicated_input_data(df)
|
|
346
334
|
if not args.allow_duplicated_input_data and is_duplicated:
|
|
347
335
|
print( # noqa: T201
|
|
348
|
-
f"{self.COMMON_MESSAGE} argument --csv: '{args.csv}' に記載されている'input_data_name'または'input_data_path'が重複しているため、入力データを登録しません。"
|
|
336
|
+
f"{self.COMMON_MESSAGE} argument --csv: '{args.csv}' に記載されている'input_data_name'または'input_data_path'が重複しているため、入力データを登録しません。"
|
|
349
337
|
f"重複している状態で入力データを登録する際は、'--allow_duplicated_input_data'を指定してください。",
|
|
350
338
|
file=sys.stderr,
|
|
351
339
|
)
|
|
@@ -67,10 +67,7 @@ class UpdateMetadataMain(CommandLineWithConfirm):
|
|
|
67
67
|
logger.warning(f"{logging_prefix} 入力データは存在しないのでスキップします。 :: input_data_id='{input_data_id}'")
|
|
68
68
|
return False
|
|
69
69
|
|
|
70
|
-
logger.debug(
|
|
71
|
-
f"{logging_prefix} input_data_id='{input_data['input_data_id']}', "
|
|
72
|
-
f"input_data_name='{input_data['input_data_name']}', metadata='{json.dumps(input_data['metadata'])}'"
|
|
73
|
-
)
|
|
70
|
+
logger.debug(f"{logging_prefix} input_data_id='{input_data['input_data_id']}', input_data_name='{input_data['input_data_name']}', metadata='{json.dumps(input_data['metadata'])}'")
|
|
74
71
|
if not self.confirm_processing(get_confirm_message()):
|
|
75
72
|
return False
|
|
76
73
|
|
|
@@ -84,9 +81,7 @@ class UpdateMetadataMain(CommandLineWithConfirm):
|
|
|
84
81
|
logger.debug(f"{logging_prefix} 入力データのメタデータを更新しました。input_data_id='{input_data['input_data_id']}'")
|
|
85
82
|
return True
|
|
86
83
|
|
|
87
|
-
def set_metadata_to_input_data_wrapper(
|
|
88
|
-
self, tpl: tuple[int, InputDataMetadataInfo], project_id: str, *, overwrite_metadata: bool = False
|
|
89
|
-
) -> bool:
|
|
84
|
+
def set_metadata_to_input_data_wrapper(self, tpl: tuple[int, InputDataMetadataInfo], project_id: str, *, overwrite_metadata: bool = False) -> bool:
|
|
90
85
|
input_data_index, info = tpl
|
|
91
86
|
return self.set_metadata_to_input_data(
|
|
92
87
|
project_id,
|
|
@@ -202,9 +197,7 @@ class UpdateMetadata(CommandLine):
|
|
|
202
197
|
sys.exit(COMMAND_LINE_ERROR_STATUS_CODE)
|
|
203
198
|
|
|
204
199
|
if input_data_id_list is not None:
|
|
205
|
-
metadata_by_input_data_id = {
|
|
206
|
-
input_data_id: metadata for input_data_id, metadata in metadata_by_input_data_id.items() if input_data_id in input_data_id_list
|
|
207
|
-
}
|
|
200
|
+
metadata_by_input_data_id = {input_data_id: metadata for input_data_id, metadata in metadata_by_input_data_id.items() if input_data_id in input_data_id_list}
|
|
208
201
|
else:
|
|
209
202
|
raise RuntimeError("'--metadata'か'--metadata_by_input_data_id'のどちらかを指定する必要があります。")
|
|
210
203
|
|
|
@@ -233,8 +226,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
233
226
|
metadata_group_parser.add_argument(
|
|
234
227
|
"--metadata",
|
|
235
228
|
type=str,
|
|
236
|
-
help="入力データに設定する ``metadata`` をJSON形式で指定してください。メタデータの値は文字列です。"
|
|
237
|
-
" ``file://`` を先頭に付けると、JSON形式のファイルを指定できます。",
|
|
229
|
+
help="入力データに設定する ``metadata`` をJSON形式で指定してください。メタデータの値は文字列です。 ``file://`` を先頭に付けると、JSON形式のファイルを指定できます。",
|
|
238
230
|
)
|
|
239
231
|
|
|
240
232
|
sample_metadata_by_input_data_id = {"input_data1": {"country": "japan"}}
|
|
@@ -251,14 +243,14 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
251
243
|
parser.add_argument(
|
|
252
244
|
"--overwrite",
|
|
253
245
|
action="store_true",
|
|
254
|
-
help="指定した場合、メタデータを上書きして更新します(すでに設定されているメタデータは削除されます)。指定しない場合、 ``--metadata`` に指定されたキーのみ更新されます。",
|
|
246
|
+
help="指定した場合、メタデータを上書きして更新します(すでに設定されているメタデータは削除されます)。指定しない場合、 ``--metadata`` に指定されたキーのみ更新されます。",
|
|
255
247
|
)
|
|
256
248
|
|
|
257
249
|
parser.add_argument(
|
|
258
250
|
"--parallelism",
|
|
259
251
|
type=int,
|
|
260
252
|
choices=PARALLELISM_CHOICES,
|
|
261
|
-
help="使用するプロセス数(並列度)を指定してください。指定する場合は必ず ``--yes`` を指定してください。指定しない場合は、逐次的に処理します。",
|
|
253
|
+
help="使用するプロセス数(並列度)を指定してください。指定する場合は必ず ``--yes`` を指定してください。指定しない場合は、逐次的に処理します。",
|
|
262
254
|
)
|
|
263
255
|
|
|
264
256
|
parser.set_defaults(subcommand_func=main)
|
|
@@ -41,7 +41,6 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
41
41
|
argument_parser.add_output()
|
|
42
42
|
|
|
43
43
|
argument_parser.add_format(choices=[FormatArgument.CSV, FormatArgument.JSON, FormatArgument.PRETTY_JSON], default=FormatArgument.CSV)
|
|
44
|
-
argument_parser.add_csv_format()
|
|
45
44
|
|
|
46
45
|
parser.set_defaults(subcommand_func=main)
|
|
47
46
|
|
|
@@ -147,10 +147,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
147
147
|
def add_parser(subparsers: Optional[argparse._SubParsersAction] = None) -> argparse.ArgumentParser:
|
|
148
148
|
subcommand_name = "upload"
|
|
149
149
|
subcommand_help = "HTMLファイルを作業ガイドとして登録します。"
|
|
150
|
-
description =
|
|
151
|
-
"HTMLファイルを作業ガイドとして登録します。"
|
|
152
|
-
"img要素のsrc属性がローカルの画像を参照している場合(http, https, dataスキーマが付与されていない)、画像もアップロードします。"
|
|
153
|
-
)
|
|
150
|
+
description = "HTMLファイルを作業ガイドとして登録します。img要素のsrc属性がローカルの画像を参照している場合(http, https, dataスキーマが付与されていない)、画像もアップロードします。"
|
|
154
151
|
epilog = "チェッカーまたはオーナロールを持つユーザで実行してください。"
|
|
155
152
|
parser = annofabcli.common.cli.add_parser(subparsers, subcommand_name, subcommand_help, description, epilog=epilog)
|
|
156
153
|
parse_args(parser)
|
annofabcli/job/list_job.py
CHANGED
|
@@ -74,12 +74,11 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
74
74
|
type=str,
|
|
75
75
|
choices=job_choices,
|
|
76
76
|
required=True,
|
|
77
|
-
help="ジョブタイプを指定します。指定できる値については https://annofab-cli.readthedocs.io/ja/latest/user_guide/command_line_options.html#job-type を参照してください。",
|
|
77
|
+
help="ジョブタイプを指定します。指定できる値については https://annofab-cli.readthedocs.io/ja/latest/user_guide/command_line_options.html#job-type を参照してください。",
|
|
78
78
|
)
|
|
79
79
|
|
|
80
80
|
argument_parser.add_format(choices=[FormatArgument.CSV, FormatArgument.JSON, FormatArgument.PRETTY_JSON], default=FormatArgument.CSV)
|
|
81
81
|
argument_parser.add_output()
|
|
82
|
-
argument_parser.add_csv_format()
|
|
83
82
|
|
|
84
83
|
parser.set_defaults(subcommand_func=main)
|
|
85
84
|
|
annofabcli/job/list_last_job.py
CHANGED
|
@@ -148,8 +148,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
148
148
|
"-org",
|
|
149
149
|
"--organization",
|
|
150
150
|
type=str,
|
|
151
|
-
help="
|
|
152
|
-
"自分が所属している進行中のプロジェクトが対象になります。",
|
|
151
|
+
help="組織配下のすべてのプロジェクトのジョブを出力したい場合は、組織名を指定してください。自分が所属している進行中のプロジェクトが対象になります。",
|
|
153
152
|
)
|
|
154
153
|
|
|
155
154
|
parser.add_argument(
|
|
@@ -160,7 +159,6 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
160
159
|
|
|
161
160
|
argument_parser.add_format(choices=[FormatArgument.CSV, FormatArgument.JSON, FormatArgument.PRETTY_JSON], default=FormatArgument.CSV)
|
|
162
161
|
argument_parser.add_output()
|
|
163
|
-
argument_parser.add_csv_format()
|
|
164
162
|
|
|
165
163
|
parser.set_defaults(subcommand_func=main)
|
|
166
164
|
|
|
@@ -49,9 +49,7 @@ class ChangeOrganizationMemberMain(CommandLineWithConfirm):
|
|
|
49
49
|
logger.warning(f"組織メンバにuser_id='{user_id}'のユーザが存在しません。")
|
|
50
50
|
continue
|
|
51
51
|
|
|
52
|
-
if not self.confirm_processing(
|
|
53
|
-
f"user_id='{user_id}'のユーザの組織メンバロールを'{role}'に変更しますか? :: username='{member['username']}', role='{member['role']}'"
|
|
54
|
-
):
|
|
52
|
+
if not self.confirm_processing(f"user_id='{user_id}'のユーザの組織メンバロールを'{role}'に変更しますか? :: username='{member['username']}', role='{member['role']}'"):
|
|
55
53
|
continue
|
|
56
54
|
|
|
57
55
|
try:
|
|
@@ -37,9 +37,7 @@ class DeleteOrganizationMemberMain(CommandLineWithConfirm):
|
|
|
37
37
|
return more_itertools.first_true(organization_member_list, pred=lambda e: e["user_id"] == user_id)
|
|
38
38
|
|
|
39
39
|
def delete_organization_members_from_organization(self, organization_name: str, user_ids: Collection[str]) -> None:
|
|
40
|
-
if not self.facade.contains_any_organization_member_role(
|
|
41
|
-
organization_name, {OrganizationMemberRole.ADMINISTRATOR, OrganizationMemberRole.OWNER}
|
|
42
|
-
):
|
|
40
|
+
if not self.facade.contains_any_organization_member_role(organization_name, {OrganizationMemberRole.ADMINISTRATOR, OrganizationMemberRole.OWNER}):
|
|
43
41
|
logger.warning(f"組織'{organization_name}'に所属していないか、組織メンバーを脱退できるロールを持たないため、スキップします。")
|
|
44
42
|
return
|
|
45
43
|
|
|
@@ -55,9 +53,7 @@ class DeleteOrganizationMemberMain(CommandLineWithConfirm):
|
|
|
55
53
|
logger.warning(f"組織'{organization_name}'に user_id='{user_id}'のメンバーが存在しません。")
|
|
56
54
|
continue
|
|
57
55
|
|
|
58
|
-
if not self.confirm_processing(
|
|
59
|
-
f"組織'{organization_name}'に所属する user_id='{user_id}'のメンバーを脱退させますか? :: username='{member['username']}'"
|
|
60
|
-
):
|
|
56
|
+
if not self.confirm_processing(f"組織'{organization_name}'に所属する user_id='{user_id}'のメンバーを脱退させますか? :: username='{member['username']}'"):
|
|
61
57
|
continue
|
|
62
58
|
|
|
63
59
|
try:
|
|
@@ -30,9 +30,7 @@ class InviteOrganizationMemberMain(CommandLineWithConfirm):
|
|
|
30
30
|
super().__init__(all_yes)
|
|
31
31
|
|
|
32
32
|
def invite_members_to_organization(self, organization_name: str, user_ids: Collection[str], role: str) -> None:
|
|
33
|
-
if not self.facade.contains_any_organization_member_role(
|
|
34
|
-
organization_name, {OrganizationMemberRole.ADMINISTRATOR, OrganizationMemberRole.OWNER}
|
|
35
|
-
):
|
|
33
|
+
if not self.facade.contains_any_organization_member_role(organization_name, {OrganizationMemberRole.ADMINISTRATOR, OrganizationMemberRole.OWNER}):
|
|
36
34
|
logger.warning(f"組織'{organization_name}'に所属していないか、組織メンバーを招待できるロールを持たないため、スキップします。")
|
|
37
35
|
return
|
|
38
36
|
|