File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,22 @@ def deferred_load(self, url):
95
95
self .loading [url ] = threading .Thread (target = self ._load , args = (url ,))
96
96
self .loading [url ].start ()
97
97
98
+ def show_cache (self ):
99
+ cache_dir = os .path .join (tempfile .gettempdir (), "odml.cache" )
100
+ onlyfiles = [f for f in os .listdir (cache_dir ) if os .path .isfile (os .path .join (cache_dir , f ))]
101
+ print ("terminology %s \t updated" % (19 * " " ))
102
+ print (60 * "-" )
103
+ for f in onlyfiles :
104
+ cache_file = os .path .join (cache_dir , f )
105
+ file_timestamp = datetime .datetime .fromtimestamp (os .path .getmtime (cache_file ))
106
+ disp_name = '_' .join (f .split ('__' )[1 :])
107
+ if len (disp_name ) > 30 :
108
+ disp_name = disp_name [:16 ] + "..."
109
+ if len (disp_name ) < 30 :
110
+ disp_name = disp_name + (30 - len (disp_name )) * " "
111
+ print (" %s \t %s" % (disp_name , file_timestamp ))
112
+
113
+
98
114
terminologies = Terminologies ()
99
115
load = terminologies .load
100
116
deferred_load = terminologies .deferred_load
You can’t perform that action at this time.
0 commit comments