summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-12-13 14:33:47 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-12-13 14:33:47 +0100
commit6d30e3203c96203cfea1f052c5e66a0632152dfd (patch)
treecc80af7fda1080ab87e3c949b0e04faedcd55129
parentitems: Add Item.digest() (diff)
downloadrtems-central-6d30e3203c96203cfea1f052c5e66a0632152dfd.tar.bz2
items: Remove unused ItemCache.top_level
-rw-r--r--rtemsspec/items.py8
-rw-r--r--rtemsspec/tests/test_items_itemcache.py4
2 files changed, 1 insertions, 11 deletions
diff --git a/rtemsspec/items.py b/rtemsspec/items.py
index 85a713f0..7a789c7a 100644
--- a/rtemsspec/items.py
+++ b/rtemsspec/items.py
@@ -539,7 +539,6 @@ class ItemCache:
""" This class provides a cache of specification items. """
def __init__(self, config: Any):
self._items = {} # type: ItemMap
- self._top_level = {} # type: ItemMap
self._updates = 0
self._load_items(config)
spec_root = config["spec-type-root-uid"]
@@ -566,11 +565,6 @@ class ItemCache:
""" Returns the map of all specification items. """
return self._items
- @property
- def top_level(self) -> ItemMap:
- """ Returns the map of top-level specification items. """
- return self._top_level
-
def add_volatile_item(self, path: str, uid: str) -> Item:
"""
Adds an item stored in the specified file to the cache and returns it.
@@ -587,8 +581,6 @@ class ItemCache:
def _add_item(self, uid: str, data: Any) -> Item:
item = Item(self, uid, data)
self._items[uid] = item
- if not item["links"]:
- self._top_level[uid] = item
return item
def _load_items_in_dir(self, base: str, path: str, cache_file: str,
diff --git a/rtemsspec/tests/test_items_itemcache.py b/rtemsspec/tests/test_items_itemcache.py
index d90b1e04..0dbe0c69 100644
--- a/rtemsspec/tests/test_items_itemcache.py
+++ b/rtemsspec/tests/test_items_itemcache.py
@@ -45,9 +45,7 @@ def test_load(tmpdir):
assert os.path.exists(os.path.join(cache_dir, "spec", "d", "spec.pickle"))
assert item_cache["/d/c"]["v"] == "c"
assert item_cache["/p"]["v"] == "p"
- t = item_cache.top_level
- assert len(t) == 1
- p = t["/p"]
+ p = item_cache["/p"]
assert p["v"] == "p"
assert p.map("/p") == p
assert p.map("p") == p