diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-06-28 17:06:43 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-07-15 07:40:32 +0000 |
commit | 52a8860147a9ca688e77a5cd6c69c3bbef038641 (patch) | |
tree | f4a6ae2f1d33a4cab805352a29294d295c52a876 /src/buildstream | |
parent | 0c0867b8c34dd480f6ca6c10e9a0f7a0a668f6f1 (diff) | |
download | buildstream-52a8860147a9ca688e77a5cd6c69c3bbef038641.tar.gz |
_yaml: Decomission 'dump()'. 'roundtrip_dump' is an equivalent function now
Remove completely '_yaml.dump()' and replace all notions and call by
'roundtrip_dump'
Diffstat (limited to 'src/buildstream')
-rw-r--r-- | src/buildstream/_artifact.py | 2 | ||||
-rw-r--r-- | src/buildstream/_stream.py | 2 | ||||
-rw-r--r-- | src/buildstream/_workspaces.py | 4 | ||||
-rw-r--r-- | src/buildstream/_yaml.pyx | 15 |
4 files changed, 4 insertions, 19 deletions
diff --git a/src/buildstream/_artifact.py b/src/buildstream/_artifact.py index ec574e335..4e7fa4911 100644 --- a/src/buildstream/_artifact.py +++ b/src/buildstream/_artifact.py @@ -147,7 +147,7 @@ class Artifact(): # Store public data with utils._tempnamedfile_name(dir=self._tmpdir) as tmpname: - _yaml.dump(publicdata, tmpname) + _yaml.roundtrip_dump(publicdata, tmpname) public_data_digest = self._cas.add_object(path=tmpname, link_directly=True) artifact.public_data.CopyFrom(public_data_digest) size += public_data_digest.size_bytes diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py index 705e0a5d3..3c32ff616 100644 --- a/src/buildstream/_stream.py +++ b/src/buildstream/_stream.py @@ -930,7 +930,7 @@ class Stream(): } workspaces.append(workspace_detail) - _yaml.dump({ + _yaml.roundtrip_dump({ 'workspaces': workspaces }) diff --git a/src/buildstream/_workspaces.py b/src/buildstream/_workspaces.py index 95c1817ce..ed50828a3 100644 --- a/src/buildstream/_workspaces.py +++ b/src/buildstream/_workspaces.py @@ -125,7 +125,7 @@ class WorkspaceProject(): # def write(self): os.makedirs(self._directory, exist_ok=True) - _yaml.dump(self.to_dict(), self.get_filename()) + _yaml.roundtrip_dump(self.to_dict(), self.get_filename()) # get_filename() # @@ -530,7 +530,7 @@ class Workspaces(): } } os.makedirs(self._bst_directory, exist_ok=True) - _yaml.dump(config, self._get_filename()) + _yaml.roundtrip_dump(config, self._get_filename()) # _load_config() # diff --git a/src/buildstream/_yaml.pyx b/src/buildstream/_yaml.pyx index 365615b73..81c456932 100644 --- a/src/buildstream/_yaml.pyx +++ b/src/buildstream/_yaml.pyx @@ -833,21 +833,6 @@ cpdef Node load_data(str data, int file_index=_SYNTHETIC_FILE_INDEX, str file_na return contents -# dump() -# -# Write a YAML node structure out to disk. -# -# This will always call `node_sanitize` on its input, so if you wanted -# to output something close to what you read in, consider using the -# `roundtrip_load` and `roundtrip_dump` function pair instead. -# -# Args: -# contents (any): Content to write out -# filename (str): The (optional) file name to write out to -def dump(object contents, str filename=None): - roundtrip_dump(node_sanitize(contents), file=filename) - - # node_get_provenance() # # Gets the provenance for a node |