[Zope-CVS] CVS: Products/AdaptableStorage/serial_ofs - FolderItems.py:1.7 MetaTypeClassifier.py:1.9
Shane Hathaway
shane@zope.com
Mon, 9 Dec 2002 17:11:38 -0500
Update of /cvs-repository/Products/AdaptableStorage/serial_ofs
In directory cvs.zope.org:/tmp/cvs-serv31255/serial_ofs
Modified Files:
FolderItems.py MetaTypeClassifier.py
Log Message:
Successfully created a CMF site on the filesystem (yehaw!)
This involved some minor fixes:
- cPickle doesn't like anything but strings as persistent IDs. Fixed by
encoding (aspect_name, name) as a string.
- The "isPrincipiaFolderish" test isn't thorough enough; we really need to
know whether the objectItems() method exists. Switched to testing for
the ObjectManager base class. (In Zope 3 this will be an interface check.)
- Added a workaround for the tricky skins tool.
- New unit test for remainder pickling.
- Better integration with DBTab.
=== Products/AdaptableStorage/serial_ofs/FolderItems.py 1.6 => 1.7 ===
--- Products/AdaptableStorage/serial_ofs/FolderItems.py:1.6 Mon Dec 9 13:25:28 2002
+++ Products/AdaptableStorage/serial_ofs/FolderItems.py Mon Dec 9 17:11:07 2002
@@ -36,7 +36,7 @@
return self.schema
def serialize(self, object, event):
- assert isinstance(object, ObjectManager)
+ assert isinstance(object, ObjectManager), repr(object)
state = []
event.ignoreAttribute('_objects')
for id, subob in object.objectItems():
=== Products/AdaptableStorage/serial_ofs/MetaTypeClassifier.py 1.8 => 1.9 ===
--- Products/AdaptableStorage/serial_ofs/MetaTypeClassifier.py:1.8 Mon Dec 9 15:27:08 2002
+++ Products/AdaptableStorage/serial_ofs/MetaTypeClassifier.py Mon Dec 9 17:11:07 2002
@@ -19,6 +19,7 @@
import os
from Acquisition import aq_base
+from OFS.ObjectManager import ObjectManager
from serial_public import IClassifier, DeserializationError
@@ -36,7 +37,7 @@
self.fmt_to_mt = {}
self.mt_to_mapper = {}
- def register(self, meta_type, mapper_name, extensions):
+ def register(self, meta_type, mapper_name, extensions=()):
for ext in extensions:
if not ext.startswith('.'):
ext = '.' + ext
@@ -74,8 +75,7 @@
mt = value.meta_type
mapper_name = self.mt_to_mapper.get(mt)
if mapper_name is None:
- folderish = not not getattr(
- aq_base(value), 'isPrincipiaFolderish', None)
+ folderish = isinstance(value, ObjectManager)
# Store in a default format
if folderish:
fmt = 'folder'