Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Properties | Private Member Functions | Private Attributes
kss.core.pluginregistry._concatresource.cachingadapter.CachedResource Class Reference

List of all members.

Public Member Functions

def __init__
def purgeData

Public Attributes

 context
 lmt_last_checked
 data_last_fetched

Properties

 data = property(lambda self: self._fetchdata()['data'], None, _deldata)
 content_type = property(lambda self: self._fetchdata()['content_type'], None, _deldata)
 lmt = property(lambda self: self._fetchlm()['lmt'])
 lmh = property(lambda self: self._fetchlm()['lmh'])
 caching = property(lambda self: self.context.caching)
 lmt_check_period = property(lambda self: self.context.lmt_check_period)

Private Member Functions

def _fetchdata
def _deldata
def _fetchlm

Private Attributes

 _contents
 print "*****Resource from cached"
 _last_mod

Detailed Description

Definition at line 12 of file cachingadapter.py.


Constructor & Destructor Documentation

Definition at line 16 of file cachingadapter.py.

00016 
00017     def __init__(self, context):
00018         self.context = context
00019         self.lmt_last_checked = 0
00020         self.data_last_fetched = 0
    

Here is the caller graph for this function:


Member Function Documentation

Definition at line 31 of file cachingadapter.py.

00031 
00032     def _deldata(self):
00033         del self._contents

Here is the caller graph for this function:

Definition at line 21 of file cachingadapter.py.

00021 
00022     def _fetchdata(self):
00023         try:
00024             result = self._contents
00025             ##print "*****Resource from cached"
00026         except AttributeError:
00027             result = self._contents = self.context.getContents()
00028             self.data_last_fetched = time()
00029             ##print "*****Resource kooked"
00030         return result

Definition at line 49 of file cachingadapter.py.

00049 
00050     def _fetchlm(self):
00051         now = time()
00052         if now - self.lmt_last_checked > self.lmt_check_period:
00053             self.lmt_last_checked = now
00054             lmt = float(self.context.getLastMod()) or now
00055             lmh = rfc1123_date(lmt)
00056             d = self._last_mod = dict(lmt = lmt, lmh = lmh)
00057             ##print "***** LMT reread", d
00058         else:
00059             d = self._last_mod
00060         return d
            

Definition at line 34 of file cachingadapter.py.

00034 
00035     def purgeData(self):
00036         'Force file contents to be reloaded'
00037         ##print "***** PURGE", self.context.__name__
00038         try:
00039             self._deldata()
00040         except AttributeError:
00041             pass

Here is the call graph for this function:


Member Data Documentation

print "*****Resource from cached"

Definition at line 26 of file cachingadapter.py.

Definition at line 55 of file cachingadapter.py.

Definition at line 17 of file cachingadapter.py.

Definition at line 19 of file cachingadapter.py.

Definition at line 18 of file cachingadapter.py.


Property Documentation

kss.core.pluginregistry._concatresource.cachingadapter.CachedResource.caching = property(lambda self: self.context.caching) [static]

Definition at line 64 of file cachingadapter.py.

Definition at line 45 of file cachingadapter.py.

kss.core.pluginregistry._concatresource.cachingadapter.CachedResource.data = property(lambda self: self._fetchdata()['data'], None, _deldata) [static]

Definition at line 44 of file cachingadapter.py.

kss.core.pluginregistry._concatresource.cachingadapter.CachedResource.lmh = property(lambda self: self._fetchlm()['lmh']) [static]

Definition at line 62 of file cachingadapter.py.

kss.core.pluginregistry._concatresource.cachingadapter.CachedResource.lmt = property(lambda self: self._fetchlm()['lmt']) [static]

Definition at line 61 of file cachingadapter.py.

kss.core.pluginregistry._concatresource.cachingadapter.CachedResource.lmt_check_period = property(lambda self: self.context.lmt_check_period) [static]

Definition at line 65 of file cachingadapter.py.


The documentation for this class was generated from the following file: