annofabcli 1.106.3__py3-none-any.whl → 1.106.4__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.
@@ -74,21 +74,26 @@ class AttributeRestrictionMessage:
74
74
  属性の種類がドロップダウンかセレクトボックスのときは、選択肢の名前を返す。
75
75
 
76
76
  Args:
77
- value (str): _description_
78
- attribute (Optional[dict[str,Any]]): _description_
77
+ value: 制約条件の値
78
+ attribute: 属性情報
79
79
 
80
80
  Returns:
81
- str: _description_
81
+ valueが'foo'の場合:
82
+ - 属性の種類が排他選択でない場合: `'foo'` (valueを返す)
83
+ - 属性の種類が排他選択である場合: `'FOO'` (選択肢の名前を返す)
84
+ - `OutputFormat.DETAILED_TEXT` AND 属性の種類が排他選択である場合: `'FOO' (id='foo')` (選択肢の名前とIDを返す)
85
+
82
86
  """
83
87
  if attribute is not None and attribute["type"] in ["choice", "select"]:
84
88
  # ラジオボタンかドロップダウンのとき
85
89
  choices = attribute["choices"]
86
90
  choice = first_true(choices, pred=lambda e: e["choice_id"] == value)
87
- if choice is not None:
88
- choice_name = AnnofabApiFacade.get_choice_name_en(choice)
89
- tmp = f"'{value}'"
91
+ if value == "" or choice is not None:
92
+ # `value == ""`を判定条件に加える理由:「排他選択属性が空である/空でない」という制約の場合、`value`は空文字列になるため。
93
+ choice_name = AnnofabApiFacade.get_choice_name_en(choice) if choice is not None else ""
94
+ tmp = f"'{choice_name}'"
90
95
  if self.output_format == OutputFormat.DETAILED_TEXT:
91
- tmp = f"{tmp} (name='{choice_name}')"
96
+ tmp = f"{tmp} (id='{value}')"
92
97
  return tmp
93
98
 
94
99
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: annofabcli
3
- Version: 1.106.3
3
+ Version: 1.106.4
4
4
  Summary: Utility Command Line Interface for AnnoFab
5
5
  Author: Kurusugawa Computer Inc.
6
6
  License: MIT
@@ -19,7 +19,7 @@ annofabcli/annotation/restore_annotation.py,sha256=F0_p1k0Yzx0YVOuLYOS48OWutsN5y
19
19
  annofabcli/annotation/subcommand_annotation.py,sha256=PfiU4G_Col3quCXKbZpqWoUXGi5p2uB1XI9BKMwaq1I,2288
20
20
  annofabcli/annotation_specs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  annofabcli/annotation_specs/add_attribute_restriction.py,sha256=jVA7ltharabR94bf71QuW0x0yVgu6-A7PHn7Dq3kUfg,6825
22
- annofabcli/annotation_specs/attribute_restriction.py,sha256=tXcCLWVUdmmLWFHLjtSERcgxwFhqk7_zyKZzps0oyso,10123
22
+ annofabcli/annotation_specs/attribute_restriction.py,sha256=Ximx5BHK28raHC2WRwP2W6FfuPvCmHu3PGife9MoZHQ,10687
23
23
  annofabcli/annotation_specs/export_annotation_specs.py,sha256=hPDkkzVl1alhSEmRim6w9Vcz5_30fRY0np8GmCEkpcY,4791
24
24
  annofabcli/annotation_specs/get_annotation_specs_with_attribute_id_replaced.py,sha256=pJxr90AvE3bd4vg6A4yhq-wjT86ACBxGZu1Lt-Xw08k,8200
25
25
  annofabcli/annotation_specs/get_annotation_specs_with_choice_id_replaced.py,sha256=QrF4k_isyFPN6OKNafl_7rbHhlkQp8ITkfOh39NZizg,6797
@@ -209,8 +209,8 @@ annofabcli/task_history_event/download_task_history_event_json.py,sha256=hQLVbQ0
209
209
  annofabcli/task_history_event/list_all_task_history_event.py,sha256=EeKMyPUxGwYCFtWQHHW954ZserGm8lUqrwNnV1iX9X4,6830
210
210
  annofabcli/task_history_event/list_worktime.py,sha256=Y7Pu5DP7scPf7HPt6CTiTvB1_5_Nfi1bStUIaCpkhII,15507
211
211
  annofabcli/task_history_event/subcommand_task_history_event.py,sha256=mJVJoT4RXk4HWnY7-Nrsl4If-gtaIIEXd2z7eFZwM2I,1260
212
- annofabcli-1.106.3.dist-info/METADATA,sha256=LbAdYDBRhLmbDAO51FlNar220liORAfuTYJiTYyZGRQ,5286
213
- annofabcli-1.106.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
214
- annofabcli-1.106.3.dist-info/entry_points.txt,sha256=C2uSUc-kkLJpoK_mDL5FEMAdorLEMPfwSf8VBMYnIFM,56
215
- annofabcli-1.106.3.dist-info/licenses/LICENSE,sha256=pcqWYfxFtxBzhvKp3x9MXNM4xciGb2eFewaRhXUNHlo,1081
216
- annofabcli-1.106.3.dist-info/RECORD,,
212
+ annofabcli-1.106.4.dist-info/METADATA,sha256=ww3ad21ZDcJuBWjrPIw1gktGa0f8go2pGkSGi6zNYP8,5286
213
+ annofabcli-1.106.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
214
+ annofabcli-1.106.4.dist-info/entry_points.txt,sha256=C2uSUc-kkLJpoK_mDL5FEMAdorLEMPfwSf8VBMYnIFM,56
215
+ annofabcli-1.106.4.dist-info/licenses/LICENSE,sha256=pcqWYfxFtxBzhvKp3x9MXNM4xciGb2eFewaRhXUNHlo,1081
216
+ annofabcli-1.106.4.dist-info/RECORD,,