Package Pyblosxom :: Package cache :: Module entrypickle :: Class BlosxomCache
[hide private]
[frames] | no frames]

Class BlosxomCache

source code

base.BlosxomCacheBase --+
                        |
                       BlosxomCache

This cache stores each entry as a separate pickle file of the entry's contents.

Instance Methods [hide private]
 
__init__(self, req, config)
Takes in a PyBlosxom request object and a configuration string which determines where to store the pickle files.
source code
 
load(self, entryid)
Takes an entryid and keeps track of the filename.
source code
 
getEntry(self)
Open the pickle file and return the data therein.
source code
boolean
isCached(self)
Check to see if the file is updated.
source code
 
saveEntry(self, entrydata)
Save the data in the entry object to a pickle file.
source code
 
rmEntry(self)
Removes the pickle file for this entry if it exists.
source code
list of strings
keys(self)
Returns a list of the keys found in this entrypickle instance.
source code
string
__makepath(self, path)
Creates the directory and all parent directories for a specified path.
source code
    Inherited from base.BlosxomCacheBase
 
__delitem__(self, key)
Convenience function to make this look more like a dict.
source code
 
__getitem__(self, key)
Convenience function to make this class look like a dict.
source code
 
__setitem__(self, key, value)
Synonymous to saveEntry
source code
 
close(self)
Override this to close your cache if necessary.
source code
 
get(self, key, default=None)
Convenience function to make this look more like a dict.
source code
 
has_key(self, key)
Convenience function to make this look more like a dict.
source code
Instance Variables [hide private]
    Inherited from base.BlosxomCacheBase
string _config
String containing config on where to store the cache.
Method Details [hide private]

__init__(self, req, config)
(Constructor)

source code 
Takes in a PyBlosxom request object and a configuration string which determines where to store the pickle files.
Overrides: base.BlosxomCacheBase.__init__

load(self, entryid)

source code 
Takes an entryid and keeps track of the filename. We only open the file when it's requested with getEntry.
Overrides: base.BlosxomCacheBase.load

getEntry(self)

source code 
Open the pickle file and return the data therein. If this fails, then we return None.
Overrides: base.BlosxomCacheBase.getEntry

isCached(self)

source code 
Check to see if the file is updated.
Returns: boolean
0 or 1 based on cache
Overrides: base.BlosxomCacheBase.isCached

saveEntry(self, entrydata)

source code 
Save the data in the entry object to a pickle file.
Overrides: base.BlosxomCacheBase.saveEntry

rmEntry(self)

source code 
Removes the pickle file for this entry if it exists.
Overrides: base.BlosxomCacheBase.rmEntry

keys(self)

source code 
Returns a list of the keys found in this entrypickle instance. This corresponds to the list of entries that are cached.
Returns: list of strings
list of full paths to entries that are cached
Overrides: base.BlosxomCacheBase.keys

__makepath(self, path)

source code 
Creates the directory and all parent directories for a specified path.
Parameters:
  • path (string) - the path to create
Returns: string
the normalized absolute path