163
def load(self, uri, nonetwork=False, age=None):
159
164
'''Downloads the file associated with the URI, and returns a local
160
165
file name for contents.'''
161
166
# pass file URIs straight through -- no need to cache them
162
167
parts = urlparse.urlparse(uri)
163
168
if parts[0] in ('', 'file'):
168
176
# is the file cached and not expired?
170
178
entry = self.entries.get(uri)
172
180
if (nonetwork or now <= entry.expires):
173
181
return os.path.join(self.cachedir, entry.local)
179
186
request = urllib2.Request(uri)