[Zope3-checkins] CVS: Zope3/src/persistence - __init__.py:1.1.2.3 _persistent.py:1.1.2.2 cache.py:1.1.2.2 dict.py:1.1.2.3 interfaces.py:1.1.2.3 list.py:1.1.2.3
Tim Peters
tim.one@comcast.net
Tue, 24 Dec 2002 21:21:28 -0500
Update of /cvs-repository/Zope3/src/persistence
In directory cvs.zope.org:/tmp/cvs-serv19240/src/persistence
Modified Files:
Tag: NameGeddon-branch
__init__.py _persistent.py cache.py dict.py interfaces.py
list.py
Log Message:
Whitespace normalization, via Python's Tools/scripts/reindent.py. The
files are fixed-points of that script now. Fixed a few cases where
code relied on significant trailing whitespace (ouch).
=== Zope3/src/persistence/__init__.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/persistence/__init__.py:1.1.2.2 Mon Dec 23 16:20:02 2002
+++ Zope3/src/persistence/__init__.py Tue Dec 24 21:19:57 2002
@@ -2,14 +2,14 @@
#
# 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.
-#
+#
##############################################################################
"""Provide access to Persistent C extension types."""
=== Zope3/src/persistence/_persistent.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/persistence/_persistent.py:1.1.2.1 Mon Dec 23 14:30:40 2002
+++ Zope3/src/persistence/_persistent.py Tue Dec 24 21:19:57 2002
@@ -2,14 +2,14 @@
#
# 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.
-#
+#
##############################################################################
from time import time
from persistence.interfaces import IPersistent
=== Zope3/src/persistence/cache.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/persistence/cache.py:1.1.2.1 Mon Dec 23 14:30:40 2002
+++ Zope3/src/persistence/cache.py Tue Dec 24 21:19:57 2002
@@ -2,14 +2,14 @@
#
# 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.
-#
+#
##############################################################################
from time import time
from sys import getrefcount
@@ -86,7 +86,7 @@
# how many objects do we scan?
n=min(multiple * max((na-self._size)/10, 3), na)
-
+
# how long can objects be inactive?
inactive = self._inactive * (
0.2 + 0.1 * (min(100, 8 * self._size/na))
@@ -114,7 +114,7 @@
if ob is self: continue
ob=ob()
state = ob._p_changed
-
+
if state==0 and abs(ob._p_atime-now) > inactive:
doomed.append(oid)
continue
@@ -136,7 +136,7 @@
active=self.__active
ghosts=self.__ghosts
na=len(active)
-
+
# how long can objects be inactive?
inactive = self._inactive * (
0.2 + 0.1 * (min(100, 8 * self._size/na))
@@ -202,13 +202,13 @@
'ghosts': len(self.__ghosts),
'active': len(self.__active),
}
-
+
class _dictdel(object):
__slots__ = 'oid', 'dict'
def __init__(self, oid, dict):
self.oid, self.dict = oid, dict
-
+
def __call__(self, ref):
del self.dict[self.oid]
=== Zope3/src/persistence/dict.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/persistence/dict.py:1.1.2.2 Mon Dec 23 16:48:42 2002
+++ Zope3/src/persistence/dict.py Tue Dec 24 21:19:57 2002
@@ -2,14 +2,14 @@
#
# 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 container type
=== Zope3/src/persistence/interfaces.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/persistence/interfaces.py:1.1.2.2 Mon Dec 23 16:20:37 2002
+++ Zope3/src/persistence/interfaces.py Tue Dec 24 21:19:57 2002
@@ -2,14 +2,14 @@
#
# 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.
-#
+#
##############################################################################
from zope.interface import Interface
from zope.interface import Attribute
@@ -38,7 +38,7 @@
This state is identical to the up-to-date state except that the
object cannot transition to the ghost state. This is a special
state used by C methods of persistent objects to make sure that
- state is not unloaded in the middle of computation.
+ state is not unloaded in the middle of computation.
In this state, the _p_changed attribute is non-None and false
and the _p_jar attribute is set to a data manager.
@@ -190,7 +190,7 @@
Change the object to the up-to-date state if it is a ghost.
"""
-
+
def _p_deactivate():
"""Deactivate the object
@@ -239,7 +239,7 @@
The modification time may not be known, in which case None
is returned.
"""
-
+
class ICache(Interface):
"""In-memory object cache
=== Zope3/src/persistence/list.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/persistence/list.py:1.1.2.2 Mon Dec 23 16:48:42 2002
+++ Zope3/src/persistence/list.py Tue Dec 24 21:19:57 2002
@@ -2,14 +2,14 @@
#
# 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 list.
@@ -49,7 +49,7 @@
def __delslice__(self, i, j):
self.__super_delslice(i, j)
self._p_changed = True
-
+
def __iadd__(self, other):
self.__super_iadd(other)
self._p_changed = True
@@ -61,7 +61,7 @@
def append(self, item):
self.__super_append(item)
self._p_changed = True
-
+
def insert(self, i, item):
self.__super_insert(i, item)
self._p_changed = True
@@ -74,11 +74,11 @@
def remove(self, item):
self.__super_remove(item)
self._p_changed = True
-
+
def reverse(self):
self.__super_reverse()
self._p_changed = True
-
+
def sort(self, *args):
self.__super_sort(*args)
self._p_changed = True