[Zope] FSDump Product query

Paul Smith paul.smith at bristol.ac.uk
Fri Aug 12 07:24:58 EDT 2005


Hi,

We've been playing with the FSDump product 
(http://www.zope.org/Members/tseaver/FSDump) over the last few days, and 
all appears to be working fine, except for exporting ZClass based objects.

The 'offending' part of the Dumper.py script appears to be:

def _dumpZClass( self, obj, path=None ):
         #   Dump properties of obj (assumed to be a ZClass) to the
         #   filesystem as a directory, including propertysheets and
         #   methods, as well as any nested ZClasses.
         if path is None:
             path = ''
         path = os.path.join( path, obj.id )
         file = self._createMetadataFile( path, '' )
         file.write( 'title:string=%s\n' % obj.title )

### only getting this far as _zclass_ causes attribute error

         file.write( 'metatype:string=%s\n' % obj._zclass_.meta_type )
         file.write( 'bases:tokens=%s\n'
                   % ','.join( map( lambda klass: str(klass), 
obj._zbases ) )
                   )
         file.write( 'class_id:int=%s\n' % obj._zclass_.__module__ )
         file.close()

I've indicated within the code snippet above that when parsing ZClass 
objects, it's only working to the point where it's successfully written 
out the title to the .metadata file, but then fails. We put in some 
debug logging, which reveals:

exceptions.AttributeError _zclass_[('zope/Products/FSDump/Dumper.py', 
158, '_dumpObject', 'handler( object, path )'), 
('zope/Products/FSDump/Dumper.py', 454, '_dumpZClass', "file.write( 
'metatype:string=%s\\n' % obj._zclass_.meta_type )")])

which suggests _zclass_ is an attribute not available on our objects.

These are fairly basic ZClass objects for news items, and I've tried 
creating several additional test Products to try and determine what is 
required to get this to work, but to no avail.

If anyone has any pointers as to what needs doing to get FSDump to dump 
out ZClass objects, I'd be more than happy to hear suggestions!

(This is using Zope 2.7.6)

Cheers

Paul


-- 
----------------------------------------------------------------------
Paul.Smith at bristol.ac.uk
----------------------------------------------------------------------
Senior Technical Officer       | Technical Manager
Internet Development Group     | RDN Virtual Training Suite
http://www.ilrt.bris.ac.uk/id/ | http://www.vts.rdn.ac.uk/
----------------------------------------------------------------------
Institute for Learning and Research Technology,
University of Bristol, 8-10 Berkeley Square,
Bristol BS8 1HH, UK Tel: +44 (0)117 928 7192, Fax: +44 (0)117 928 7112


More information about the Zope mailing list