Commit 14b1ec0d authored by Tim Peters's avatar Tim Peters

Whitespace normalization.

parent 11cdf9fc
......@@ -28,7 +28,7 @@ class Length(persistent.Persistent):
longer works as expected, because new-style classes cache
class-defined slot methods (like __len__) in C type slots. Thus,
instance-define slot fillers are ignores.
"""
def __init__(self, v=0):
......
......@@ -722,4 +722,3 @@ def test_suite():
NastyConfict):
suite.addTest(makeSuite(k))
return suite
......@@ -13,7 +13,7 @@
##############################################################################
"""Persistence and ExtensionClass combined
$Id: __init__.py,v 1.7 2003/12/15 07:30:27 jim Exp $
$Id: __init__.py,v 1.8 2003/12/29 22:40:45 tim_one Exp $
"""
from persistent import PickleCache
......@@ -53,4 +53,3 @@ import sys
sys.modules['BoboPOS'] = sys.modules['Persistence']
sys.modules['BoboPOS.PersistentMapping'] = sys.modules['Persistence.mapping']
del sys
......@@ -14,9 +14,9 @@
"""Python implementation of persistent base types
$Id: mapping.py,v 1.1 2003/12/15 06:56:46 jim Exp $"""
$Id: mapping.py,v 1.2 2003/12/29 22:40:45 tim_one Exp $"""
__version__='$Revision: 1.1 $'[11:-2]
__version__='$Revision: 1.2 $'[11:-2]
import Persistence
import persistent
......@@ -25,13 +25,13 @@ 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']
......
......@@ -13,7 +13,7 @@
##############################################################################
"""Test ExtensionClass support in Persistence.Persistent
$Id: test_ExtensionClass.py,v 1.2 2003/11/28 16:44:47 jim Exp $
$Id: test_ExtensionClass.py,v 1.3 2003/12/29 22:40:46 tim_one Exp $
"""
from Persistence import Persistent
......@@ -59,7 +59,7 @@ else:
('bar called', 42)
This is for compatability with old code. New code should use super
instead.
instead.
The base class, Base, exists mainly to support the __of__ protocol.
The __of__ protocol is similar to __get__ except that __of__ is called
......@@ -89,7 +89,7 @@ else:
>>> class O(Base):
... def __get__(*a):
... return a
...
...
>>> o1 = O()
>>> o2 = O()
>>> C.o1 = o1
......@@ -105,8 +105,8 @@ else:
def test_mixing():
"""Test working with a classic class
>>> class Classic:
... def x(self):
>>> class Classic:
... def x(self):
... return 42
>>> class O(Persistent):
......@@ -115,7 +115,7 @@ else:
>>> class O2(Classic, O):
... def __of__(*a):
... return (O2.inheritedAttribute('__of__')(*a),
... return (O2.inheritedAttribute('__of__')(*a),
... O2.inheritedAttribute('x')(a[0]))
>>> class C(Persistent):
......@@ -135,13 +135,13 @@ else:
Test working with a new style
>>> class Modern(object):
... def x(self):
>>> class Modern(object):
... def x(self):
... return 42
>>> class O2(Modern, O):
... def __of__(*a):
... return (O2.inheritedAttribute('__of__')(*a),
... return (O2.inheritedAttribute('__of__')(*a),
... O2.inheritedAttribute('x')(a[0]))
>>> o2 = O2()
......@@ -235,7 +235,7 @@ else:
def test_class_creation_under_stress():
"""
>>> for i in range(100):
>>> for i in range(100):
... class B(Persistent):
... print i,
... if i and i%20 == 0:
......@@ -286,7 +286,7 @@ def test_basic_pickling():
>>> print_dict(x.__getstate__())
{'__name__': 'x', 'aaa': 1, 'bbb': 'foo'}
>>> f, (c,), state = x.__reduce__()
>>> f.__name__
'__newobj__'
......@@ -294,10 +294,10 @@ def test_basic_pickling():
'copy_reg'
>>> c.__name__
'Simple'
>>> print_dict(state)
{'__name__': 'x', 'aaa': 1, 'bbb': 'foo'}
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
......@@ -347,7 +347,7 @@ def test_pickling_w_overrides():
'Custom'
>>> ax, ay, a
('x', 'y', 99)
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
......@@ -356,7 +356,7 @@ def test_pickling_w_overrides():
1
>>> pickle.loads(pickle.dumps(x, 2)) == x
1
"""
class Slotted(Persistent):
......@@ -372,7 +372,7 @@ class SubSlotted(Slotted):
Slotted.__init__(self, s1, s2)
self.s3 = s3
def __cmp__(self, other):
return cmpattrs(self, other, '__class__', 's1', 's2', 's3', 's4')
......@@ -388,7 +388,7 @@ def test_pickling_w_slots_only():
>>> d
>>> print_dict(s)
{'s1': 'x', 's2': 'y', 's3': 'z'}
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
......@@ -399,12 +399,12 @@ def test_pickling_w_slots_only():
1
>>> x.s4 = 'spam'
>>> d, s = x.__getstate__()
>>> d
>>> print_dict(s)
{'s1': 'x', 's2': 'y', 's3': 'z', 's4': 'spam'}
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
......@@ -423,7 +423,7 @@ class SubSubSlotted(SubSlotted):
self.__dict__.update(kw)
self._v_favorite_color = 'blue'
self._p_foo = 'bar'
def __cmp__(self, other):
return cmpattrs(self, other,
'__class__', 's1', 's2', 's3', 's4',
......@@ -441,7 +441,7 @@ def test_pickling_w_slots():
{'aaa': 1, 'bbb': 'foo'}
>>> print_dict(s)
{'s1': 'x', 's2': 'y', 's3': 'z'}
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
......@@ -452,7 +452,7 @@ def test_pickling_w_slots():
1
>>> x.s4 = 'spam'
>>> d, s = x.__getstate__()
>>> print_dict(d)
{'aaa': 1, 'bbb': 'foo'}
......@@ -482,7 +482,7 @@ def test_pickling_w_slots_w_empty_dict():
{}
>>> print_dict(s)
{'s1': 'x', 's2': 'y', 's3': 'z'}
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
......@@ -493,7 +493,7 @@ def test_pickling_w_slots_w_empty_dict():
1
>>> x.s4 = 'spam'
>>> d, s = x.__getstate__()
>>> print_dict(d)
{}
......@@ -520,6 +520,3 @@ def test_suite():
))
if __name__ == '__main__': unittest.main()
......@@ -13,7 +13,7 @@
##############################################################################
"""XXX short summary goes here.
$Id: test_mapping.py,v 1.1 2003/12/15 06:58:26 jim Exp $
$Id: test_mapping.py,v 1.2 2003/12/29 22:40:46 tim_one Exp $
"""
import unittest
from doctest import DocTestSuite
......@@ -80,7 +80,7 @@ def test_old_pickles():
>>> items.sort()
>>> items
[('x', 1), ('y', 2)]
"""
def test_suite():
......
......@@ -29,7 +29,7 @@ def session_key(username, realm, password):
return sha.new("%s:%s:%s" % (username, realm, password)).hexdigest()
class StorageClass(ZEOStorage):
def auth(self, username, password):
try:
dbpw = self.database.get_password(username)
......
......@@ -37,7 +37,7 @@ class TransBufTests(unittest.TestCase):
tbuf.invalidate(*new_invalidate_data())
for o in tbuf:
pass
def doUpdates(self, tbuf):
data = []
for i in range(10):
......
......@@ -130,7 +130,7 @@ class CacheTests(unittest.TestCase):
self.cache.store(n2, "version", n2, None, "version data for n2")
self.cache.store(n3, "", n3, n4, "non-current data for n3")
self.cache.store(n3, "", n4, n5, "more non-current data for n3")
path = tempfile.mktemp()
# Copy data from self.cache into path, reaching into the cache
# guts to make the copy.
......
......@@ -47,8 +47,8 @@ def usage(msg):
def options(args):
"""Password-specific options loaded from regular ZEO config file."""
try:
opts, args = getopt.getopt(args, "dr:p:f:C:", ["configure=",
"protocol=",
opts, args = getopt.getopt(args, "dr:p:f:C:", ["configure=",
"protocol=",
"filename=",
"realm"])
except getopt.error, msg:
......@@ -56,7 +56,7 @@ def options(args):
config = None
delete = 0
auth_protocol = None
auth_db = ""
auth_db = ""
auth_realm = None
for k, v in opts:
if k == '-C' or k == '--configure':
......@@ -127,4 +127,3 @@ def main(args=None, dbclass=None):
if __name__ == "__main__":
main(sys.argv[1:])
......@@ -13,7 +13,7 @@
##############################################################################
"""Storage implementation using a log written to a single file.
$Revision: 1.2 $
$Revision: 1.3 $
"""
import base64
......@@ -607,12 +607,12 @@ class FileStorage(BaseStorage.BaseStorage,
if h.tid < tid:
break
pos = h.prev
end_tid = h.tid
if not pos:
return None
if h.back:
data, _, _, _ = self._loadBack_impl(oid, h.back)
return data, h.tid, end_tid
......
......@@ -13,7 +13,7 @@
##############################################################################
"""Transaction management
$Id: Transaction.py,v 1.55 2003/11/28 16:44:49 jim Exp $
$Id: Transaction.py,v 1.56 2003/12/29 22:40:48 tim_one Exp $
"""
import sys
from thread import get_ident as _get_ident
......@@ -271,7 +271,7 @@ class Transaction:
"abort. This shouldn't happen.",
error=sys.exc_info())
raise error[0], error[1], error[2]
def _get_jars(self, objects, subtransaction):
# Returns a list of jars for this transaction.
......
......@@ -205,7 +205,7 @@ class VersionStorage:
# is not current
self._dostore(oid, revid=tid, data=MinPO(17))
ltid = self._storage.lastTransaction()
ncdata, ncstart, end = self._storage.loadBefore(oid, ltid)
self.assertEqual(data, ncdata)
......
......@@ -300,4 +300,3 @@ def test_suite():
if __name__ == "__main__":
unittest.main(defaultTest="test_suite")
......@@ -13,7 +13,7 @@
##############################################################################
"""Basic pickling tests
$Id: test_pickle.py,v 1.2 2003/11/28 16:44:56 jim Exp $
$Id: test_pickle.py,v 1.3 2003/12/29 22:40:50 tim_one Exp $
"""
from persistent import Persistent
......@@ -55,7 +55,7 @@ def test_basic_pickling():
>>> print_dict(x.__getstate__())
{'__name__': 'x', 'aaa': 1, 'bbb': 'foo'}
>>> f, (c,), state = x.__reduce__()
>>> f.__name__
'__newobj__'
......@@ -63,10 +63,10 @@ def test_basic_pickling():
'copy_reg'
>>> c.__name__
'Simple'
>>> print_dict(state)
{'__name__': 'x', 'aaa': 1, 'bbb': 'foo'}
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
......@@ -116,7 +116,7 @@ def test_pickling_w_overrides():
'Custom'
>>> ax, ay, a
('x', 'y', 99)
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
......@@ -125,7 +125,7 @@ def test_pickling_w_overrides():
1
>>> pickle.loads(pickle.dumps(x, 2)) == x
1
"""
class Slotted(Persistent):
......@@ -141,7 +141,7 @@ class SubSlotted(Slotted):
Slotted.__init__(self, s1, s2)
self.s3 = s3
def __cmp__(self, other):
return cmpattrs(self, other, '__class__', 's1', 's2', 's3', 's4')
......@@ -157,7 +157,7 @@ def test_pickling_w_slots_only():
>>> d
>>> print_dict(s)
{'s1': 'x', 's2': 'y', 's3': 'z'}
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
......@@ -168,12 +168,12 @@ def test_pickling_w_slots_only():
1
>>> x.s4 = 'spam'
>>> d, s = x.__getstate__()
>>> d
>>> print_dict(s)
{'s1': 'x', 's2': 'y', 's3': 'z', 's4': 'spam'}
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
......@@ -192,7 +192,7 @@ class SubSubSlotted(SubSlotted):
self.__dict__.update(kw)
self._v_favorite_color = 'blue'
self._p_foo = 'bar'
def __cmp__(self, other):
return cmpattrs(self, other,
'__class__', 's1', 's2', 's3', 's4',
......@@ -210,7 +210,7 @@ def test_pickling_w_slots():
{'aaa': 1, 'bbb': 'foo'}
>>> print_dict(s)
{'s1': 'x', 's2': 'y', 's3': 'z'}
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
......@@ -221,7 +221,7 @@ def test_pickling_w_slots():
1
>>> x.s4 = 'spam'
>>> d, s = x.__getstate__()
>>> print_dict(d)
{'aaa': 1, 'bbb': 'foo'}
......@@ -251,7 +251,7 @@ def test_pickling_w_slots_w_empty_dict():
{}
>>> print_dict(s)
{'s1': 'x', 's2': 'y', 's3': 'z'}
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
......@@ -262,7 +262,7 @@ def test_pickling_w_slots_w_empty_dict():
1
>>> x.s4 = 'spam'
>>> d, s = x.__getstate__()
>>> print_dict(d)
{}
......@@ -289,6 +289,3 @@ def test_suite():
))
if __name__ == '__main__': unittest.main()
......@@ -164,7 +164,7 @@ def main(path):
if tid is not None:
txn_objects.add(objects)
m = rx_txn.search(line)
if not m:
continue
......
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