annofabcli 1.98.0__py3-none-any.whl → 1.100.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/__version__.py +1 -1
- annofabcli/annotation_specs/add_attribute_restriction.py +158 -0
- annofabcli/annotation_specs/attribute_restriction.py +240 -0
- annofabcli/annotation_specs/list_attribute_restriction.py +8 -209
- annofabcli/annotation_specs/put_label_color.py +5 -0
- annofabcli/annotation_specs/subcommand_annotation_specs.py +2 -0
- annofabcli/comment/delete_comment.py +3 -0
- annofabcli/comment/put_inspection_comment.py +3 -0
- annofabcli/comment/put_onhold_comment.py +3 -0
- annofabcli/input_data/change_input_data_name.py +4 -1
- annofabcli/input_data/put_input_data.py +4 -0
- annofabcli/statistics/list_annotation_attribute_filled_count.py +684 -0
- annofabcli/statistics/list_annotation_count.py +80 -37
- annofabcli/statistics/list_annotation_duration.py +18 -18
- annofabcli/statistics/subcommand_statistics.py +3 -0
- annofabcli/task/list_tasks_added_task_history.py +141 -156
- annofabcli/task/put_tasks.py +9 -4
- {annofabcli-1.98.0.dist-info → annofabcli-1.100.0.dist-info}/METADATA +1 -1
- {annofabcli-1.98.0.dist-info → annofabcli-1.100.0.dist-info}/RECORD +22 -19
- {annofabcli-1.98.0.dist-info → annofabcli-1.100.0.dist-info}/LICENSE +0 -0
- {annofabcli-1.98.0.dist-info → annofabcli-1.100.0.dist-info}/WHEEL +0 -0
- {annofabcli-1.98.0.dist-info → annofabcli-1.100.0.dist-info}/entry_points.txt +0 -0
|
@@ -2,6 +2,7 @@ import argparse
|
|
|
2
2
|
from typing import Optional
|
|
3
3
|
|
|
4
4
|
import annofabcli
|
|
5
|
+
import annofabcli.annotation_specs.add_attribute_restriction
|
|
5
6
|
import annofabcli.annotation_specs.export_annotation_specs
|
|
6
7
|
import annofabcli.annotation_specs.get_annotation_specs_with_attribute_id_replaced
|
|
7
8
|
import annofabcli.annotation_specs.get_annotation_specs_with_choice_id_replaced
|
|
@@ -20,6 +21,7 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
20
21
|
subparsers = parser.add_subparsers(dest="subcommand_name")
|
|
21
22
|
|
|
22
23
|
# サブコマンドの定義
|
|
24
|
+
annofabcli.annotation_specs.add_attribute_restriction.add_parser(subparsers)
|
|
23
25
|
annofabcli.annotation_specs.export_annotation_specs.add_parser(subparsers)
|
|
24
26
|
annofabcli.annotation_specs.get_annotation_specs_with_attribute_id_replaced.add_parser(subparsers)
|
|
25
27
|
annofabcli.annotation_specs.get_annotation_specs_with_choice_id_replaced.add_parser(subparsers)
|
|
@@ -225,6 +225,9 @@ class DeleteComment(CommandLine):
|
|
|
225
225
|
super().validate_project(args.project_id, [ProjectMemberRole.ACCEPTER, ProjectMemberRole.OWNER])
|
|
226
226
|
|
|
227
227
|
dict_comments = annofabcli.common.cli.get_json_from_args(args.json)
|
|
228
|
+
if not isinstance(dict_comments, dict):
|
|
229
|
+
print(f"{self.COMMON_MESSAGE} argument --json: JSON形式が不正です。オブジェクトを指定してください。", file=sys.stderr) # noqa: T201
|
|
230
|
+
sys.exit(COMMAND_LINE_ERROR_STATUS_CODE)
|
|
228
231
|
main_obj = DeleteCommentMain(self.service, project_id=args.project_id, all_yes=self.all_yes)
|
|
229
232
|
main_obj.delete_comments_for_task_list(
|
|
230
233
|
comment_ids_for_task_list=dict_comments,
|
|
@@ -44,6 +44,9 @@ class PutInspectionComment(CommandLine):
|
|
|
44
44
|
super().validate_project(args.project_id, [ProjectMemberRole.ACCEPTER, ProjectMemberRole.OWNER])
|
|
45
45
|
|
|
46
46
|
dict_comments = annofabcli.common.cli.get_json_from_args(args.json)
|
|
47
|
+
if not isinstance(dict_comments, dict):
|
|
48
|
+
print(f"{self.COMMON_MESSAGE} argument --json: JSON形式が不正です。オブジェクトを指定してください。", file=sys.stderr) # noqa: T201
|
|
49
|
+
sys.exit(COMMAND_LINE_ERROR_STATUS_CODE)
|
|
47
50
|
comments_for_task_list = convert_cli_comments(dict_comments, comment_type=CommentType.INSPECTION)
|
|
48
51
|
main_obj = PutCommentMain(self.service, project_id=args.project_id, comment_type=CommentType.INSPECTION, all_yes=self.all_yes)
|
|
49
52
|
main_obj.add_comments_for_task_list(
|
|
@@ -42,6 +42,9 @@ class PutInspectionComment(CommandLine):
|
|
|
42
42
|
super().validate_project(args.project_id)
|
|
43
43
|
|
|
44
44
|
dict_comments = annofabcli.common.cli.get_json_from_args(args.json)
|
|
45
|
+
if not isinstance(dict_comments, dict):
|
|
46
|
+
print(f"{self.COMMON_MESSAGE} argument --json: JSON形式が不正です。オブジェクトを指定してください。", file=sys.stderr) # noqa: T201
|
|
47
|
+
sys.exit(COMMAND_LINE_ERROR_STATUS_CODE)
|
|
45
48
|
comments_for_task_list = convert_cli_comments(
|
|
46
49
|
dict_comments,
|
|
47
50
|
comment_type=CommentType.ONHOLD,
|
|
@@ -177,7 +177,10 @@ class ChangeInputDataName(CommandLine):
|
|
|
177
177
|
changed_input_data_list = create_changed_input_data_list_from_csv(args.csv)
|
|
178
178
|
|
|
179
179
|
elif args.json is not None:
|
|
180
|
-
input_data_dict_list
|
|
180
|
+
input_data_dict_list = get_json_from_args(args.json)
|
|
181
|
+
if not isinstance(input_data_dict_list, list):
|
|
182
|
+
print("annofabcli input_data change_name: error: JSON形式が不正です。オブジェクトの配列を指定してください。", file=sys.stderr) # noqa: T201
|
|
183
|
+
sys.exit(COMMAND_LINE_ERROR_STATUS_CODE)
|
|
181
184
|
changed_input_data_list = create_changed_input_data_list_from_dict(input_data_dict_list)
|
|
182
185
|
else:
|
|
183
186
|
raise RuntimeError("'--csv'または'--json'のいずれかを指定してください。")
|
|
@@ -356,6 +356,10 @@ class PutInputData(CommandLine):
|
|
|
356
356
|
|
|
357
357
|
elif args.json is not None:
|
|
358
358
|
input_data_dict_list = get_json_from_args(args.json)
|
|
359
|
+
if not isinstance(input_data_dict_list, list):
|
|
360
|
+
print(f"{self.COMMON_MESSAGE} argument --json: JSON形式が不正です。オブジェクトの配列を指定してください。", file=sys.stderr) # noqa: T201
|
|
361
|
+
sys.exit(COMMAND_LINE_ERROR_STATUS_CODE)
|
|
362
|
+
|
|
359
363
|
input_data_list = self.get_input_data_list_from_dict(input_data_dict_list, allow_duplicated_input_data=args.allow_duplicated_input_data)
|
|
360
364
|
self.put_input_data_list(project_id, input_data_list=input_data_list, overwrite=args.overwrite, parallelism=args.parallelism)
|
|
361
365
|
|