[CMF-checkins] CVS: Products/CMFCore - DirectoryView.py:1.51
Jens Vagelpohl
jens at dataflake.org
Sun Mar 6 07:29:33 EST 2005
Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv4910/CMFCore
Modified Files:
DirectoryView.py
Log Message:
- DirectoryView and derived classes can now have metadata associated with
them just like regular FSObject-derived objects can.
=== Products/CMFCore/DirectoryView.py 1.50 => 1.51 ===
--- Products/CMFCore/DirectoryView.py:1.50 Mon Feb 28 16:47:21 2005
+++ Products/CMFCore/DirectoryView.py Sun Mar 6 07:29:02 2005
@@ -190,7 +190,12 @@
t = registry.getTypeByMetaType(mt)
if t is None:
t = DirectoryView
- ob = t(entry, entry_minimal_fp)
+ metadata = FSMetadata(entry_filepath)
+ metadata.read()
+ ob = t( entry
+ , entry_minimal_fp
+ , properties=metadata.getProperties()
+ )
ob_id = ob.getId()
data[ob_id] = ob
objects.append({'id': ob_id, 'meta_type': ob.meta_type})
@@ -374,11 +379,18 @@
"""
meta_type = 'Filesystem Directory View'
_dirpath = None
+ _properties = None
_objects = ()
- def __init__(self, id, dirpath, fullname=None):
+ def __init__(self, id, dirpath, fullname=None, properties=None):
+ if properties:
+ # Since props come from the filesystem, this should be
+ # safe.
+ self.__dict__.update(properties)
+
self.id = id
self._dirpath = dirpath
+ self._properties = properties
def __of__(self, parent):
info = _dirreg.getDirectoryInfo(self._dirpath)
More information about the CMF-checkins
mailing list