[Zope-CVS] CVS: Products/FileCacheManager - FileCacheManager.py:1.9
Jens Vagelpohl
jens at dataflake.org
Fri Aug 13 14:42:22 EDT 2004
Update of /cvs-repository/Products/FileCacheManager
In directory cvs.zope.org:/tmp/cvs-serv2983
Modified Files:
FileCacheManager.py
Log Message:
- first cut at edit screen and method
=== Products/FileCacheManager/FileCacheManager.py 1.8 => 1.9 ===
--- Products/FileCacheManager/FileCacheManager.py:1.8 Fri Aug 13 12:58:29 2004
+++ Products/FileCacheManager/FileCacheManager.py Fri Aug 13 14:41:51 2004
@@ -154,6 +154,14 @@
""" A cache manager for caching data to filesystem """
security = ClassSecurityInfo()
meta_type = 'File Cache Manager'
+ manage_fs = PageTemplateFile('www/editFCM', globals())
+
+ manage_options = (
+ ( { 'label' : 'File System', 'action' : 'manage_fs',
+ 'help' : ('FileCacheManager', 'Edit.stx') }
+ ,
+ ) + RAMCacheManager.manage_options
+ )
def __init__(self, ob_id, path='/tmp', title=''):
@@ -204,6 +212,19 @@
self._dir = path
except ValueError:
pass
+
+ security.declareProtected('Change cache managers', 'manage_edit')
+ def manage_edit(self, path='/tmp', REQUEST=None):
+ """ Edit the filesystem-related values """
+ if os.access(path, os.W_OK):
+ msg = 'Changes saved.'
+ self.setDir(path)
+ else:
+ msg = 'Invalid directory "%s"' % path
+
+ if REQUEST is not None:
+ return self.manage_fs(self, REQUEST, manage_tabs_message=msg)
+
InitializeClass(FileCacheManager)
More information about the Zope-CVS
mailing list