You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ro...@apache.org on 2020/12/29 13:36:23 UTC
[buildstream] 05/05: _yaml_roundtrip.py: Remove YAML cache logic
This is an automated email from the ASF dual-hosted git repository.
root pushed a commit to branch jennis/add_yaml_roundtrip_module
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 2b556cdeaaa250bd25579fca7c7786d5a7ec7b7b
Author: James Ennis <ja...@codethink.co.uk>
AuthorDate: Thu Mar 7 16:46:48 2019 +0000
_yaml_roundtrip.py: Remove YAML cache logic
---
buildstream/_yaml_roundtrip.py | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/buildstream/_yaml_roundtrip.py b/buildstream/_yaml_roundtrip.py
index 482e23b..47a8e22 100644
--- a/buildstream/_yaml_roundtrip.py
+++ b/buildstream/_yaml_roundtrip.py
@@ -182,13 +182,12 @@ class CompositeTypeError(CompositeError):
# shortname (str): The filename in shorthand for error reporting (or None)
# copy_tree (bool): Whether to make a copy, preserving the original toplevels
# for later serialization
-# yaml_cache (YamlCache): A yaml cache to consult rather than parsing
#
# Returns (dict): A loaded copy of the YAML file with provenance information
#
# Raises: LoadError
#
-def load(filename, shortname=None, copy_tree=False, *, project=None, yaml_cache=None):
+def load(filename, shortname=None, copy_tree=False, *, project=None):
if not shortname:
shortname = filename
@@ -198,13 +197,9 @@ def load(filename, shortname=None, copy_tree=False, *, project=None, yaml_cache=
data = None
with open(filename) as f:
contents = f.read()
- if yaml_cache:
- data, key = yaml_cache.get(project, filename, contents, copy_tree)
if not data:
data = load_data(contents, file, copy_tree=copy_tree)
- if yaml_cache:
- yaml_cache.put_from_key(project, filename, key, data)
return data
except FileNotFoundError as e: