File tree Expand file tree Collapse file tree 3 files changed +7
-112
lines changed
Expand file tree Collapse file tree 3 files changed +7
-112
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -11,24 +11,24 @@ def __init__(self, directory):
1111 self .cache_file .seek (0 )
1212 content = self .cache_file .read ()
1313 if len (content ) == 0 :
14- self .cache = {}
14+ self .cache_dict = {}
1515 else :
16- self .cache = json .loads (content )
16+ self .cache_dict = json .loads (content )
1717
1818 def put (self , key : str , value : dict ):
19- self .cache [key ] = value
19+ self .cache_dict [key ] = value
2020 self ._overwrite ()
2121
2222 def get (self , key : str ) -> Optional [dict ]:
23- return self .cache .get (key , None )
23+ return self .cache_dict .get (key , None )
2424
2525 def delete (self , key : str ):
26- if key not in self .cache :
26+ if key not in self .cache_dict :
2727 return
28- del self .cache [key ]
28+ del self .cache_dict [key ]
2929
3030 def _overwrite (self ):
3131 with open (self .cache_file .name , "w" ) as self .cache_file :
3232 self .cache_file .seek (0 )
33- self .cache_file .write (json .dumps (self .cache ))
33+ self .cache_file .write (json .dumps (self .cache_dict ))
3434 self .cache_file .truncate ()
You can’t perform that action at this time.
0 commit comments