dcicutils 8.8.3.1b15__py3-none-any.whl → 8.8.3.1b17__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.
- dcicutils/captured_output.py +2 -0
- dcicutils/progress_bar.py +9 -1
- dcicutils/structured_data.py +17 -3
- {dcicutils-8.8.3.1b15.dist-info → dcicutils-8.8.3.1b17.dist-info}/METADATA +1 -1
- {dcicutils-8.8.3.1b15.dist-info → dcicutils-8.8.3.1b17.dist-info}/RECORD +8 -8
- {dcicutils-8.8.3.1b15.dist-info → dcicutils-8.8.3.1b17.dist-info}/LICENSE.txt +0 -0
- {dcicutils-8.8.3.1b15.dist-info → dcicutils-8.8.3.1b17.dist-info}/WHEEL +0 -0
- {dcicutils-8.8.3.1b15.dist-info → dcicutils-8.8.3.1b17.dist-info}/entry_points.txt +0 -0
dcicutils/captured_output.py
CHANGED
@@ -24,6 +24,8 @@ def captured_output(capture: bool = True, encoding: Optional[str] = None):
|
|
24
24
|
|
25
25
|
original_stdout = _real_stdout
|
26
26
|
original_stderr = _real_stderr
|
27
|
+
# FYI: This encoding business with _EncodedStringIO was introduced (circa April 2024)
|
28
|
+
# when ran into issues unit testing progress_bar which outputs those funny block characters.
|
27
29
|
captured_output = io.StringIO() if not encoding else _EncodedStringIO(encoding)
|
28
30
|
|
29
31
|
def set_original_output() -> None:
|
dcicutils/progress_bar.py
CHANGED
@@ -335,7 +335,15 @@ class ProgressBar:
|
|
335
335
|
nonlocal sys_stdout_write
|
336
336
|
if sys_stdout_write is not None:
|
337
337
|
sys.stdout.write = sys_stdout_write
|
338
|
+
def ascii_spinners() -> list: # noqa
|
339
|
+
# Fun with ASCII spinners.
|
340
|
+
return list("⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏") # borrowed from rich python package
|
341
|
+
# return list("⣾⣽⣻⢿⡿⣟⣯⣷") # borrowed from rich python package
|
342
|
+
# return list("⠿⠻⠽⠾⠷⠯⠟")
|
343
|
+
# return list("⠏⠛⠹⠼⠶⠧")
|
344
|
+
# return list("⠻⠽⠾⠷⠯⠟")
|
345
|
+
# return list("|/—◦\\")
|
338
346
|
sys.stdout.write = tidy_stdout_write
|
339
|
-
spina =
|
347
|
+
spina = ascii_spinners() ; spini = 0 ; spinn = len(spina) # noqa
|
340
348
|
sentinel = "[progress]" ; sentinel_internal = f"{sentinel}:" # noqa
|
341
349
|
return namedtuple("tidy_output_hack", ["restore", "sentinel"])(restore_stdout_write, sentinel)
|
dcicutils/structured_data.py
CHANGED
@@ -174,6 +174,18 @@ class StructuredDataSet:
|
|
174
174
|
result = []
|
175
175
|
if self._norefs:
|
176
176
|
for ref in self._resolved_refs:
|
177
|
+
# The structure of this self._resolved_refs is setup in Schema._map_function_ref,
|
178
|
+
# which is called whenever a reference (linkTo) is encountered. It is a set of
|
179
|
+
# tuples containing three items: [0] the ref path, [1] its uuid (if applicable),
|
180
|
+
# and [2] its src. The src identifies the place where this ref occurred and is a
|
181
|
+
# dictionary containing file, type, column, and row properties. For this case, of
|
182
|
+
# norefs (i.e. unchecked refs), the uuid ([1]) is None because we are skipping
|
183
|
+
# ref resolution. But the src is actually a *string* dump of the dictionary, only
|
184
|
+
# because dictionaries cannot be put in a set (which is what _resolved_refs is);
|
185
|
+
# this dump is also done in Schema._map_function_ref (should probably change this
|
186
|
+
# to be a list to avoid this - TODO); we only even store this src info for this
|
187
|
+
# norefs case, as not really needed otherwise. This is just to support the
|
188
|
+
# useful-for-troublehsooting options --info --refs for smaht-submitr.
|
177
189
|
if len(ref) >= 3 and (ref_path := ref[0]) and (ref_src := load_json(ref[2])):
|
178
190
|
if existing_ref := [item for item in result if item.get("path") == ref_path]:
|
179
191
|
existing_ref[0]["srcs"].append(ref_src)
|
@@ -681,9 +693,11 @@ class Schema(SchemaBase):
|
|
681
693
|
# Here the caller has specified the (StructuredDataSet) norefs option
|
682
694
|
# which means we do not check for the existence of references at all.
|
683
695
|
if value:
|
684
|
-
# Dump the src as a JSON string because a dictionary cannot be added to a set;
|
685
|
-
#
|
686
|
-
# This info
|
696
|
+
# Dump the src as a JSON string because a dictionary cannot be added to a set;
|
697
|
+
# this is ONLY used for smaht-submitr/submit-metadata-bundle --info --refs.
|
698
|
+
# This info exposed via StructureDataSet.unchecked_refs. TODO: Should probably
|
699
|
+
# make this not a set type so we dont' have to do this dump (and corresponding
|
700
|
+
# load, in StructureDataSet.unchecked_refs).
|
687
701
|
self._resolved_refs.add((f"/{link_to}/{value}", None,
|
688
702
|
json.dumps(src) if isinstance(src, dict) else None))
|
689
703
|
return value
|
@@ -2,7 +2,7 @@ dcicutils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
dcicutils/base.py,sha256=gxNEv3DSVUfoX3NToWw7pcCdguxsJ75NDqsPi3wdFG4,5115
|
3
3
|
dcicutils/beanstalk_utils.py,sha256=nHMWfFnZAXFiJh60oVouwbAPMKsQfHnDtkwz_PDE6S4,51434
|
4
4
|
dcicutils/bundle_utils.py,sha256=ZVQcqlt7Yly8-YbL3A-5DW859_hMWpTL6dXtknEYZIw,34669
|
5
|
-
dcicutils/captured_output.py,sha256=
|
5
|
+
dcicutils/captured_output.py,sha256=0hP7sPwleMaYXQAvCfJOxG8Z8T_JJYy8ADp8A5ZoblE,3295
|
6
6
|
dcicutils/cloudformation_utils.py,sha256=MtWJrSTXyiImgbPHgRvfH9bWso20ZPLTFJAfhDQSVj4,13786
|
7
7
|
dcicutils/codebuild_utils.py,sha256=CKpmhJ-Z8gYbkt1I2zyMlKtFdsg7T8lqrx3V5ieta-U,1155
|
8
8
|
dcicutils/command_utils.py,sha256=JExll5TMqIcmuiGvuS8q4XDUvoEfi2oSH0E2FVF6suU,15285
|
@@ -48,7 +48,7 @@ dcicutils/obfuscation_utils.py,sha256=fo2jOmDRC6xWpYX49u80bVNisqRRoPskFNX3ymFAmj
|
|
48
48
|
dcicutils/opensearch_utils.py,sha256=V2exmFYW8Xl2_pGFixF4I2Cc549Opwe4PhFi5twC0M8,1017
|
49
49
|
dcicutils/portal_object_utils.py,sha256=gDXRgPsRvqCFwbC8WatsuflAxNiigOnqr0Hi93k3AgE,15422
|
50
50
|
dcicutils/portal_utils.py,sha256=DYyE5o15GekDgzpJWas9iS7klAYbjJZUPW0G42McArk,30779
|
51
|
-
dcicutils/progress_bar.py,sha256=
|
51
|
+
dcicutils/progress_bar.py,sha256=ux0fKSgXyX6sVfQR2II7TGEYH_ztcBMTH7OBb6J24OY,17833
|
52
52
|
dcicutils/project_utils.py,sha256=qPdCaFmWUVBJw4rw342iUytwdQC0P-XKpK4mhyIulMM,31250
|
53
53
|
dcicutils/qa_checkers.py,sha256=cdXjeL0jCDFDLT8VR8Px78aS10hwNISOO5G_Zv2TZ6M,20534
|
54
54
|
dcicutils/qa_utils.py,sha256=TT0SiJWiuxYvbsIyhK9VO4uV_suxhB6CpuC4qPacCzQ,160208
|
@@ -63,7 +63,7 @@ dcicutils/secrets_utils.py,sha256=8dppXAsiHhJzI6NmOcvJV5ldvKkQZzh3Fl-cb8Wm7MI,19
|
|
63
63
|
dcicutils/sheet_utils.py,sha256=VlmzteONW5VF_Q4vo0yA5vesz1ViUah1MZ_yA1rwZ0M,33629
|
64
64
|
dcicutils/snapshot_utils.py,sha256=ymP7PXH6-yEiXAt75w0ldQFciGNqWBClNxC5gfX2FnY,22961
|
65
65
|
dcicutils/ssl_certificate_utils.py,sha256=F0ifz_wnRRN9dfrfsz7aCp4UDLgHEY8LaK7PjnNvrAQ,9707
|
66
|
-
dcicutils/structured_data.py,sha256=
|
66
|
+
dcicutils/structured_data.py,sha256=BQuIMv6OPySsn6YxtXE2Er-zLE2QJuCYhEQ3V0u_UXY,61238
|
67
67
|
dcicutils/submitr/progress_constants.py,sha256=5bxyX77ql8qEJearfHEvsvXl7D0GuUODW0T65mbRmnE,2895
|
68
68
|
dcicutils/submitr/ref_lookup_strategy.py,sha256=Js2cVznTmgjciLWBPLCvMiwLIHXjDn3jww-gJPjYuFw,3467
|
69
69
|
dcicutils/task_utils.py,sha256=MF8ujmTD6-O2AC2gRGPHyGdUrVKgtr8epT5XU8WtNjk,8082
|
@@ -72,8 +72,8 @@ dcicutils/trace_utils.py,sha256=g8kwV4ebEy5kXW6oOrEAUsurBcCROvwtZqz9fczsGRE,1769
|
|
72
72
|
dcicutils/validation_utils.py,sha256=cMZIU2cY98FYtzK52z5WUYck7urH6JcqOuz9jkXpqzg,14797
|
73
73
|
dcicutils/variant_utils.py,sha256=2H9azNx3xAj-MySg-uZ2SFqbWs4kZvf61JnK6b-h4Qw,4343
|
74
74
|
dcicutils/zip_utils.py,sha256=rnjNv_k6L9jT2SjDSgVXp4BEJYLtz9XN6Cl2Fy-tqnM,2027
|
75
|
-
dcicutils-8.8.3.
|
76
|
-
dcicutils-8.8.3.
|
77
|
-
dcicutils-8.8.3.
|
78
|
-
dcicutils-8.8.3.
|
79
|
-
dcicutils-8.8.3.
|
75
|
+
dcicutils-8.8.3.1b17.dist-info/LICENSE.txt,sha256=qnwSmfnEWMl5l78VPDEzAmEbLVrRqQvfUQiHT0ehrOo,1102
|
76
|
+
dcicutils-8.8.3.1b17.dist-info/METADATA,sha256=lbXFoEaBL0YX-S_n15vciHm69phgyYG1Ryr3H8fJcdM,3357
|
77
|
+
dcicutils-8.8.3.1b17.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
78
|
+
dcicutils-8.8.3.1b17.dist-info/entry_points.txt,sha256=51Q4F_2V10L0282W7HFjP4jdzW4K8lnWDARJQVFy_hw,270
|
79
|
+
dcicutils-8.8.3.1b17.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|