Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
56329054
Commit
56329054
authored
Oct 02, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Batch fixes.
parent
cd0ac353
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
lib/python/ZTUtils/Batch.py
lib/python/ZTUtils/Batch.py
+3
-3
lib/python/ZTUtils/CHANGES.txt
lib/python/ZTUtils/CHANGES.txt
+1
-0
lib/python/ZTUtils/tests/testBatch.py
lib/python/ZTUtils/tests/testBatch.py
+2
-2
No files found.
lib/python/ZTUtils/Batch.py
View file @
56329054
...
...
@@ -84,8 +84,8 @@
##############################################################################
__doc__
=
'''Batch class, for iterating over a sequence in batches
$Id: Batch.py,v 1.
3 2001/10/02 18:34:30 amos
Exp $'''
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
$Id: Batch.py,v 1.
4 2001/10/02 20:54:49 evan
Exp $'''
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
from
ExtensionClass
import
Base
...
...
@@ -135,7 +135,7 @@ class Batch(Base):
if
index
+
self
.
end
<
self
.
first
:
raise
IndexError
,
index
return
self
.
_sequence
[
index
+
self
.
end
]
if
index
>=
self
.
size
:
raise
IndexError
,
index
if
index
>=
self
.
length
:
raise
IndexError
,
index
return
self
.
_sequence
[
index
+
self
.
first
]
def
__len__
(
self
):
...
...
lib/python/ZTUtils/CHANGES.txt
View file @
56329054
...
...
@@ -11,6 +11,7 @@ ZTUtils changes
- Orphans defaulted to 3, which was confusing and out of sync
with DTML-In.
- Orphan batches were broken.
lib/python/ZTUtils/tests/testBatch.py
View file @
56329054
...
...
@@ -33,11 +33,11 @@ class BatchTests(unittest.TestCase):
b
=
Batch
(
range
(
bsize
),
5
,
orphan
=
3
)
assert
b
.
next
is
None
assert
len
(
b
)
==
bsize
assert
b
[
bsize
-
1
]
==
bsize
-
1
b
=
Batch
(
range
(
8
),
5
)
assert
len
(
b
)
==
5
assert
len
(
b
.
next
)
==
3
def
test_suite
():
return
unittest
.
makeSuite
(
BatchTests
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment