MCPcopy Create free account
hub / github.com/coderick14/ACedIt / check_cache

Method check_cache

acedit/util.py:128–147  ·  view source on GitHub ↗

Method to check if the test cases already exist in cache If not, create the directory structure to store test cases

(site, contest, problem)

Source from the content-addressed store, hash-verified

126
127 @staticmethod
128 def check_cache(site, contest, problem):
129 """
130 Method to check if the test cases already exist in cache
131 If not, create the directory structure to store test cases
132 """
133
134 if problem is None:
135 if not os.path.isdir(os.path.join(Utilities.cache_dir, site, contest)):
136 os.makedirs(os.path.join(Utilities.cache_dir, site, contest))
137 return False
138
139 # Handle case for SPOJ specially as it does not have contests
140 contest = '' if site == 'spoj' else contest
141
142 if os.path.isdir(os.path.join(Utilities.cache_dir, site, contest, problem)):
143 return True
144 else:
145 os.makedirs(os.path.join(Utilities.cache_dir, site,
146 contest, problem))
147 return False
148
149 @staticmethod
150 def clear_cache(site):

Callers 3

handle_batch_requestsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected