Commit be9c3562 authored by Nicolas Delaby's avatar Nicolas Delaby

remove blank spaces

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27031 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 989c44dc
...@@ -39,18 +39,18 @@ class CacheFactory(XMLObject): ...@@ -39,18 +39,18 @@ class CacheFactory(XMLObject):
""" """
CacheFactory is a collection of cache plugins. CacheFactory is an object which lives in ZODB. CacheFactory is a collection of cache plugins. CacheFactory is an object which lives in ZODB.
""" """
meta_type = 'ERP5 Cache Factory' meta_type = 'ERP5 Cache Factory'
portal_type = 'Cache Factory' portal_type = 'Cache Factory'
isPortalContent = 1 isPortalContent = 1
isRADContent = 1 isRADContent = 1
allowed_types = ('ERP5 Ram Cache', allowed_types = ('ERP5 Ram Cache',
'ERP5 Distributed Ram Cache', 'ERP5 Distributed Ram Cache',
'ERP5 SQL Cache', 'ERP5 SQL Cache',
'ERP5 Zodb Cache', 'ERP5 Zodb Cache',
) )
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareProtected(Permissions.ManagePortal, security.declareProtected(Permissions.ManagePortal,
'manage_editProperties', 'manage_editProperties',
...@@ -63,26 +63,26 @@ class CacheFactory(XMLObject): ...@@ -63,26 +63,26 @@ class CacheFactory(XMLObject):
, PropertySheet.Folder , PropertySheet.Folder
, CacheFactory , CacheFactory
) )
def getCachePluginList(self): def getCachePluginList(self):
""" get ordered list of installed cache plugins in ZODB """ """ get ordered list of installed cache plugins in ZODB """
cache_plugins = self.objectValues(self.allowed_types) cache_plugins = self.objectValues(self.allowed_types)
cache_plugins = map(None, cache_plugins) cache_plugins = map(None, cache_plugins)
cache_plugins.sort(key=lambda x: x.getIntIndex(0)) cache_plugins.sort(key=lambda x: x.getIntIndex(0))
return cache_plugins return cache_plugins
security.declareProtected(Permissions.AccessContentsInformation, 'getRamCacheFactory') security.declareProtected(Permissions.AccessContentsInformation, 'getRamCacheFactory')
def getRamCacheFactory(self): def getRamCacheFactory(self):
""" Return RAM based cache factory """ """ Return RAM based cache factory """
erp5_site_id = self.getPortalObject().getId() erp5_site_id = self.getPortalObject().getId()
return CachingMethod.factories[erp5_site_id][self.cache_scope] return CachingMethod.factories[erp5_site_id][self.cache_scope]
security.declareProtected(Permissions.AccessContentsInformation, 'getRamCacheFactoryPluginList') security.declareProtected(Permissions.AccessContentsInformation, 'getRamCacheFactoryPluginList')
def getRamCacheFactoryPluginList(self): def getRamCacheFactoryPluginList(self):
""" Return RAM based list of cache plugins for this factory """ """ Return RAM based list of cache plugins for this factory """
return self.getRamCacheFactory().getCachePluginList() return self.getRamCacheFactory().getCachePluginList()
def clearCache(self): def clearCache(self):
""" clear cache for this cache factory """ """ clear cache for this cache factory """
for cp in self.getRamCacheFactory().getCachePluginList(): for cp in self.getRamCacheFactory().getCachePluginList():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment