Skip to content

Commit 1c0ca04

Browse files
committed
[terminology] add method to clear the cache
1 parent b02304b commit 1c0ca04

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

odml/terminology.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ def show_cache(self):
110110
disp_name = disp_name + (30 -len(disp_name)) * " "
111111
print(" %s \t %s"%(disp_name, file_timestamp))
112112

113+
def clear_cache(self):
114+
cache_dir = os.path.join(tempfile.gettempdir(), "odml.cache")
115+
filelist = [ f for f in os.listdir(cache_dir) if f.endswith(".xml") ]
116+
for f in filelist:
117+
os.remove(os.path.join(cache_dir, f))
118+
113119

114120
terminologies = Terminologies()
115121
load = terminologies.load

0 commit comments

Comments
 (0)