Skip to content

Commit 6415f3f

Browse files
fix: restore original snapshot format while maintaining API changes
Co-Authored-By: [email protected] <[email protected]>
1 parent e563d55 commit 6415f3f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

python/selfie-lib/selfie_lib/SelfieImplementations.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
TodoStub,
1212
)
1313
from .Snapshot import Snapshot
14+
from .SnapshotFile import SnapshotFile
1415
from .SnapshotSystem import DiskStorage, Mode, SnapshotSystem, _selfieSystem
1516
from .WriteTracker import recordCall as recordCall
1617

@@ -247,16 +248,15 @@ def _assertEqual(
247248

248249

249250
def _serializeOnlyFacets(snapshot: Snapshot, facets: list[str]) -> str:
250-
result = []
251+
writer = []
251252
for facet in facets:
252253
value = snapshot._subject_or_facet_maybe_internal(facet)
253254
if value is None:
254255
continue
255-
if value.is_binary:
256-
result.append(
257-
f"{facet}: base64 length {len(value.value_binary())} bytes\n"
258-
+ base64.b64encode(value.value_binary()).decode().replace("\r", "")
259-
)
256+
if not facet:
257+
SnapshotFile.writeEntry(writer, "", None, value)
260258
else:
261-
result.append(f"{facet}: {value.value_string()}")
262-
return "\n".join(result)
259+
SnapshotFile.writeEntry(writer, "", facet, value)
260+
261+
writer_str = "".join(writer)
262+
return writer_str[:-1] if writer_str else ""

0 commit comments

Comments
 (0)