Package core :: Package data :: Package url :: Package handlers :: Module localCache :: Class CachedResponse
[hide private]
[frames] | no frames]

Class CachedResponse




An urllib2.response-like object for cached responses.

To determine wheter a response is cached or coming directly from the network, check the x-cache header rather than the object type.

Instance Methods [hide private]
  __init__(self, cacheLocation, request)
  read(self)
Read at most size bytes from the file (less if the read hits EOF before obtaining size bytes).
  info(self)
  geturl(self)
  get_full_url(self)

Inherited from StringIO.StringIO: __iter__, close, flush, getvalue, isatty, next, readline, readlines, seek, tell, truncate, write, writelines


Static Methods [hide private]
  ExistsInCache(cacheLocation, id)
  StoreInCache(cacheLocation, id, response)

Method Details [hide private]

ExistsInCache(cacheLocation, id)
Static Method

 
None

StoreInCache(cacheLocation, id, response)
Static Method

 
None

__init__(self, cacheLocation, request)
(Constructor)

 
None
Overrides: StringIO.StringIO.__init__

read(self)

 

Read at most size bytes from the file (less if the read hits EOF before obtaining size bytes).

If the size argument is negative or omitted, read all data until EOF is reached. The bytes are returned as a string object. An empty string is returned when EOF is encountered immediately.
Overrides: StringIO.StringIO.read
(inherited documentation)

info(self)

 
None

geturl(self)

 
None

get_full_url(self)

 
None