-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogic.py
More file actions
20 lines (8 loc) · 761 Bytes
/
logic.py
File metadata and controls
20 lines (8 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class LogicBase(object): #API for methods such as get and set, ensure storage isn't locked before proceeding
def get(self,key):
if not self._SSDstorage.locked: #if boolean value '.locked' is False (not locked), refresh tree
self._refresh_binary_tree_ref()
return self._get(self._pathTo(self._tree_view_ref), key) #_get implementation found in binary_tree.py
def _refresh_binary_tree_ref(self): #function definition that will refresh the binary tree with updated values to disc
self._tree_view_ref = self.node_ref_class(address=self._SSDstorage.get_root_address())
#access the binary tree view by the root node and refresh the pathTo() to reflect the new key-value pair passed in