From 9fa3dd7b2f00fe2e988e319d3fdb83ee99e30cd0 Mon Sep 17 00:00:00 2001 From: WeiN76LQh Date: Thu, 28 Nov 2024 18:52:19 +0000 Subject: [SharedCache] Define BackingCacheType Split out from https://github.com/WeiN76LQh/binaryninja-api/tree/process-local-symbols --- view/sharedcache/api/python/sharedcache.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'view/sharedcache/api/python/sharedcache.py') diff --git a/view/sharedcache/api/python/sharedcache.py b/view/sharedcache/api/python/sharedcache.py index e0e18bde..e3ccbb9b 100644 --- a/view/sharedcache/api/python/sharedcache.py +++ b/view/sharedcache/api/python/sharedcache.py @@ -52,14 +52,21 @@ class DSCBackingCacheMapping: @dataclasses.dataclass class DSCBackingCache: path: str - isPrimary: bool + cacheType: BackingCacheType mappings: list[DSCBackingCacheMapping] def __str__(self): return repr(self) def __repr__(self): - return f"" + match self.cacheType: + case BackingCacheType.BackingCacheTypePrimary: + cacheTypeStr = 'Primary' + case BackingCacheType.BackingCacheTypeSecondary: + cacheTypeStr = 'Secondary' + case BackingCacheType.BackingCacheTypeSymbols: + cacheTypeStr = 'Symbols' + return f"" @dataclasses.dataclass @@ -142,7 +149,7 @@ class SharedCache: mappings.append(mapping) result.append(DSCBackingCache( value[i].path, - value[i].isPrimary, + value[i].cacheType, mappings )) -- cgit v1.3.1