[Zope-Checkins] CVS: Zope/lib/python/Persistence - mapping.py:1.1 PersistentMapping.py:NONE

Jim Fulton jim at zope.com
Mon Dec 15 01:56:47 EST 2003


Update of /cvs-repository/Zope/lib/python/Persistence
In directory cvs.zope.org:/tmp/cvs-serv10514/lib/python/Persistence

Added Files:
	mapping.py 
Removed Files:
	PersistentMapping.py 
Log Message:
Renamed the module to prevent package attr conflicts.

Added code to support old pickles. This error was causing 
attribute errors on 'data'.


=== Added File Zope/lib/python/Persistence/mapping.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################

"""Python implementation of persistent base types

$Id: mapping.py,v 1.1 2003/12/15 06:56:46 jim Exp $"""

__version__='$Revision: 1.1 $'[11:-2]

import Persistence
import persistent
from persistent.mapping import PersistentMapping

if Persistence.Persistent is not persistent.Persistent:
    class PersistentMapping(Persistence.Persistent, PersistentMapping):
        """Legacy persistent mapping class
        
        This class mixes in ExtensionClass Base if it is present.
        
        Unless you actually want ExtensionClass semantics, use
        persistent.mapping.PersistentMapping instead.
        """
            
        def __setstate__(self, state):
            if 'data' not in state:
                state['data'] = state['_container']
                del state['_container']
            self.__dict__.update(state)

=== Removed File Zope/lib/python/Persistence/PersistentMapping.py ===




More information about the Zope-Checkins mailing list