Commit a100bedf authored by Jim Fulton's avatar Jim Fulton

Changed so no longer save on del.

Added check in __save__ so that we don't save if we have decided that
we haven't changed.
parent 24cc6936
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
__doc__='''Python implementation of persistent base types __doc__='''Python implementation of persistent base types
$Id: Persistence.py,v 1.3 1997/03/08 22:03:54 jfulton Exp $''' $Id: Persistence.py,v 1.4 1997/03/14 16:19:55 jim Exp $'''
# Copyright # Copyright
# #
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne # Copyright 1996 Digital Creations, L.C., 910 Princess Anne
...@@ -60,6 +60,11 @@ $Id: Persistence.py,v 1.3 1997/03/08 22:03:54 jfulton Exp $''' ...@@ -60,6 +60,11 @@ $Id: Persistence.py,v 1.3 1997/03/08 22:03:54 jfulton Exp $'''
# (540) 371-6909 # (540) 371-6909
# #
# $Log: Persistence.py,v $ # $Log: Persistence.py,v $
# Revision 1.4 1997/03/14 16:19:55 jim
# Changed so no longer save on del.
# Added check in __save__ so that we don't save if we have decided that
# we haven't changed.
#
# Revision 1.3 1997/03/08 22:03:54 jfulton # Revision 1.3 1997/03/08 22:03:54 jfulton
# Paul made change to clear method to see if keys exist. # Paul made change to clear method to see if keys exist.
# #
...@@ -71,7 +76,7 @@ $Id: Persistence.py,v 1.3 1997/03/08 22:03:54 jfulton Exp $''' ...@@ -71,7 +76,7 @@ $Id: Persistence.py,v 1.3 1997/03/08 22:03:54 jfulton Exp $'''
# #
# #
# #
__version__='$Revision: 1.3 $'[11:-2] __version__='$Revision: 1.4 $'[11:-2]
class Persistent: class Persistent:
"""\ """\
...@@ -189,9 +194,7 @@ class Persistent: ...@@ -189,9 +194,7 @@ class Persistent:
Update the object in a persistent database. Update the object in a persistent database.
''' '''
jar=self._p_jar jar=self._p_jar
if jar: jar.store(self) if jar and self._p_changed: jar.store(self)
__del__=__save__
def __changed__(self,value=None): def __changed__(self,value=None):
'''\ '''\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment