[Zope-Checkins] CVS: Zope/lib/python/Products/Transience - Transience.py:1.28 TransienceInterfaces.py:1.15 TransientObject.py:1.9 __init__.py:1.7
Martijn Pieters
mj@zope.com
Wed, 14 Aug 2002 18:25:44 -0400
Update of /cvs-repository/Zope/lib/python/Products/Transience
In directory cvs.zope.org:/tmp/cvs-serv27658/Transience
Modified Files:
Transience.py TransienceInterfaces.py TransientObject.py
__init__.py
Log Message:
Clean up indentation and trailing whitespace.
=== Zope/lib/python/Products/Transience/Transience.py 1.27 => 1.28 ===
--- Zope/lib/python/Products/Transience/Transience.py:1.27 Wed Aug 7 10:48:48 2002
+++ Zope/lib/python/Products/Transience/Transience.py Wed Aug 14 18:25:13 2002
@@ -1,14 +1,14 @@
##############################################################################
#
# Copyright (c) 2001 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
-#
+#
##############################################################################
"""
Transient Object Container Class ('timeslice'-based design).
@@ -127,7 +127,7 @@
{ 'label': 'Manage',
'action': 'manage_container',
'help': ('Transience', 'Transience.stx')
- },
+ },
{ 'label': 'Security',
'action': 'manage_access'
},
@@ -229,7 +229,7 @@
def setAddNotificationTarget(self, f):
# We should assert that the callback function 'f' implements
# the TransientNotification interface
- self._addCallback = f
+ self._addCallback = f
security.declareProtected(MGMT_SCREEN_PERM, 'getDelNotificationTarget')
def getDelNotificationTarget(self):
@@ -252,7 +252,7 @@
def _notify(self, items, kind):
if not type(items) in [type([]), type(())]:
items = [items]
-
+
if kind =='add':
name = 'notifyAdd'
callback = self._addCallback
@@ -437,7 +437,7 @@
self._deindex_next=Increaser(self._getCurrentTimeslice())
finally:
self.lock.release()
-
+
def _getCurrentBucket(self):
"""
Do housekeeping if necessary, then return the 'current' bucket.
@@ -673,7 +673,7 @@
data[i] = OOBTree()
except Queue.Empty:
DEBUG and TLOG('replentish queue empty')
-
+
# gc the stale buckets at the "beginning" of _data ("garbage collect")
# iterate over the keys in data that have no minimum value and
# a maximum value of delete_end (note: ordered set)
@@ -741,7 +741,7 @@
finally:
self.lock.release()
-
+
def __getitem__(self, k):
self.lock.acquire()
try:
@@ -803,7 +803,7 @@
# we accessed the object, so it becomes current
# by moving it to the current bucket
del self._data[b][k] # delete the item from the old bucket.
- self._data[current][k] = v # add the value to the current
+ self._data[current][k] = v # add the value to the current
self._setLastAccessed(v)
index[k] = current # change the index to the current buck.
@@ -812,7 +812,7 @@
return v
finally:
self.lock.release()
-
+
def _setLastAccessed(self, transientObject):
self.lock.acquire()
try:
@@ -860,7 +860,7 @@
def set(self, v):
self.value = v
-
+
def __getstate__(self):
return self.value
=== Zope/lib/python/Products/Transience/TransienceInterfaces.py 1.14 => 1.15 ===
--- Zope/lib/python/Products/Transience/TransienceInterfaces.py:1.14 Thu Jun 20 21:51:43 2002
+++ Zope/lib/python/Products/Transience/TransienceInterfaces.py Wed Aug 14 18:25:13 2002
@@ -1,4 +1,4 @@
-##########################################################################
+##########################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
@@ -9,7 +9,7 @@
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
-##########################################################################
+##########################################################################
"""
Transient Objects
@@ -66,7 +66,7 @@
class Foo(Persistence.Persistent):
pass
-
+
transient_object = transient_data_container.new('t')
foo = transient_object['foo'] = Foo()
foo.bar = 1
@@ -270,7 +270,7 @@
Returned object is acquisition-wrapped in self.
"""
-
+
class TransientItemContainer(Interface.Base):
def setTimeoutMinutes(timeout_mins):
"""
=== Zope/lib/python/Products/Transience/TransientObject.py 1.8 => 1.9 ===
--- Zope/lib/python/Products/Transience/TransientObject.py:1.8 Mon Jun 24 15:31:16 2002
+++ Zope/lib/python/Products/Transience/TransientObject.py Wed Aug 14 18:25:13 2002
@@ -1,14 +1,14 @@
##############################################################################
#
# Copyright (c) 2001 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
-#
+#
##############################################################################
"""
Simple ZODB-based transient object implementation.
@@ -114,7 +114,7 @@
def getContainerKey(self):
return self.token
-
+
# -----------------------------------------------------------------
# DictionaryLike
#
@@ -132,7 +132,7 @@
v = self._container.get(k, default)
if v is _notfound: return None
return v
-
+
def has_key(self, k):
if self._container.get(k, _notfound) is not _notfound: return 1
return 0
@@ -243,7 +243,7 @@
'Conflict resolution error in TransientObject', '',
sys.exc_info()
)
-
+
getName = getId # this is for SQLSession compatibility
def _generateUniqueId(self):
=== Zope/lib/python/Products/Transience/__init__.py 1.6 => 1.7 ===
--- Zope/lib/python/Products/Transience/__init__.py:1.6 Wed Nov 28 10:51:09 2001
+++ Zope/lib/python/Products/Transience/__init__.py Wed Aug 14 18:25:13 2002
@@ -1,14 +1,14 @@
##############################################################################
#
# Copyright (c) 2001 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
-#
+#
##############################################################################
"""
Transience initialization routines
@@ -21,7 +21,7 @@
# import of MaxTransientObjectsExceeded for easy import from scripts,
# this is protected by a module security info declaration in the
# Sessions package.
-from Transience import MaxTransientObjectsExceeded
+from Transience import MaxTransientObjectsExceeded
def initialize(context):
context.registerClass(
@@ -33,4 +33,3 @@
)
context.registerHelp()
context.registerHelpTitle('Zope Help')
-