dcicutils 8.8.6.1b9__py3-none-any.whl → 8.8.6.1b11__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- dcicutils/portal_utils.py +9 -2
- {dcicutils-8.8.6.1b9.dist-info → dcicutils-8.8.6.1b11.dist-info}/METADATA +1 -1
- {dcicutils-8.8.6.1b9.dist-info → dcicutils-8.8.6.1b11.dist-info}/RECORD +6 -6
- {dcicutils-8.8.6.1b9.dist-info → dcicutils-8.8.6.1b11.dist-info}/LICENSE.txt +0 -0
- {dcicutils-8.8.6.1b9.dist-info → dcicutils-8.8.6.1b11.dist-info}/WHEEL +0 -0
- {dcicutils-8.8.6.1b9.dist-info → dcicutils-8.8.6.1b11.dist-info}/entry_points.txt +0 -0
dcicutils/portal_utils.py
CHANGED
@@ -407,6 +407,7 @@ class Portal:
|
|
407
407
|
|
408
408
|
@function_cache(maxsize=100, serialize_key=True)
|
409
409
|
def get_identifying_paths(self, portal_object: dict, portal_type: Optional[Union[str, dict]] = None,
|
410
|
+
first_only: bool = False,
|
410
411
|
lookup_strategy: Optional[Union[Callable, bool]] = None) -> List[str]:
|
411
412
|
"""
|
412
413
|
Returns the list of the identifying Portal (URL) paths for the given Portal object. Favors any uuid
|
@@ -467,7 +468,10 @@ class Portal:
|
|
467
468
|
# And note the disction of just using /{uuid} here rather than /{type}/{uuid} as in the else
|
468
469
|
# statement below is not really necessary; just here for emphasis that this is all that's needed.
|
469
470
|
#
|
470
|
-
|
471
|
+
if first_only is True:
|
472
|
+
results.append(f"/{portal_type}/{identifying_value}")
|
473
|
+
else:
|
474
|
+
results.append(f"/{identifying_value}")
|
471
475
|
elif isinstance(identifying_value, list):
|
472
476
|
for identifying_value_item in identifying_value:
|
473
477
|
if identifying_value_item:
|
@@ -497,12 +501,15 @@ class Portal:
|
|
497
501
|
if is_lookup_subtypes(lookup_options):
|
498
502
|
for subtype_name in self.get_schema_subtype_names(portal_type):
|
499
503
|
results.append(f"/{subtype_name}/{identifying_value}")
|
504
|
+
if (first_only is True) and results:
|
505
|
+
return results
|
500
506
|
return results
|
501
507
|
|
502
508
|
@function_cache(maxsize=100, serialize_key=True)
|
503
509
|
def get_identifying_path(self, portal_object: dict, portal_type: Optional[Union[str, dict]] = None,
|
504
510
|
lookup_strategy: Optional[Union[Callable, bool]] = None) -> Optional[str]:
|
505
|
-
if identifying_paths := self.
|
511
|
+
if identifying_paths := self.get_identifying_paths(portal_object, portal_type, first_only=True,
|
512
|
+
lookup_strategy=lookup_strategy):
|
506
513
|
return identifying_paths[0]
|
507
514
|
return None
|
508
515
|
|
@@ -48,7 +48,7 @@ dcicutils/misc_utils.py,sha256=zHwsxxEn24muLBP7mDvMa8I9VdMejwW8HMuCL5xbhhw,10769
|
|
48
48
|
dcicutils/obfuscation_utils.py,sha256=fo2jOmDRC6xWpYX49u80bVNisqRRoPskFNX3ymFAmjw,5963
|
49
49
|
dcicutils/opensearch_utils.py,sha256=V2exmFYW8Xl2_pGFixF4I2Cc549Opwe4PhFi5twC0M8,1017
|
50
50
|
dcicutils/portal_object_utils.py,sha256=Az3n1aL-PQkN5gOFE6ZqC2XkYsqiwKlq7-tZggs1QN4,11062
|
51
|
-
dcicutils/portal_utils.py,sha256=
|
51
|
+
dcicutils/portal_utils.py,sha256=cDMaqEW3aSDwhjJlsaVS4yEpYsmWo6yVXnLA9f4J_JY,44621
|
52
52
|
dcicutils/progress_bar.py,sha256=UT7lxb-rVF_gp4yjY2Tg4eun1naaH__hB4_v3O85bcE,19468
|
53
53
|
dcicutils/project_utils.py,sha256=qPdCaFmWUVBJw4rw342iUytwdQC0P-XKpK4mhyIulMM,31250
|
54
54
|
dcicutils/qa_checkers.py,sha256=cdXjeL0jCDFDLT8VR8Px78aS10hwNISOO5G_Zv2TZ6M,20534
|
@@ -73,8 +73,8 @@ dcicutils/trace_utils.py,sha256=g8kwV4ebEy5kXW6oOrEAUsurBcCROvwtZqz9fczsGRE,1769
|
|
73
73
|
dcicutils/validation_utils.py,sha256=cMZIU2cY98FYtzK52z5WUYck7urH6JcqOuz9jkXpqzg,14797
|
74
74
|
dcicutils/variant_utils.py,sha256=2H9azNx3xAj-MySg-uZ2SFqbWs4kZvf61JnK6b-h4Qw,4343
|
75
75
|
dcicutils/zip_utils.py,sha256=_Y9EmL3D2dUZhxucxHvrtmmlbZmK4FpSsHEb7rGSJLU,3265
|
76
|
-
dcicutils-8.8.6.
|
77
|
-
dcicutils-8.8.6.
|
78
|
-
dcicutils-8.8.6.
|
79
|
-
dcicutils-8.8.6.
|
80
|
-
dcicutils-8.8.6.
|
76
|
+
dcicutils-8.8.6.1b11.dist-info/LICENSE.txt,sha256=qnwSmfnEWMl5l78VPDEzAmEbLVrRqQvfUQiHT0ehrOo,1102
|
77
|
+
dcicutils-8.8.6.1b11.dist-info/METADATA,sha256=VlpuTBAxKkqXFztHeEfDLxXP_BBRVBbpjmQoaEjGuJo,3440
|
78
|
+
dcicutils-8.8.6.1b11.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
79
|
+
dcicutils-8.8.6.1b11.dist-info/entry_points.txt,sha256=51Q4F_2V10L0282W7HFjP4jdzW4K8lnWDARJQVFy_hw,270
|
80
|
+
dcicutils-8.8.6.1b11.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|