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
73592a00
Commit
73592a00
authored
Mar 15, 2002
by
Chris Withers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added useful 'total' attribute to batches.
parent
8215b816
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
lib/python/ZTUtils/Batch.py
lib/python/ZTUtils/Batch.py
+5
-2
lib/python/ZTUtils/CHANGES.txt
lib/python/ZTUtils/CHANGES.txt
+6
-0
No files found.
lib/python/ZTUtils/Batch.py
View file @
73592a00
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
##############################################################################
##############################################################################
__doc__
=
'''Batch class, for iterating over a sequence in batches
__doc__
=
'''Batch class, for iterating over a sequence in batches
$Id: Batch.py,v 1.
7 2002/02/15 16:26:56 evan
Exp $'''
$Id: Batch.py,v 1.
8 2002/03/15 16:01:52 chrisw
Exp $'''
__version__
=
'$Revision: 1.
7
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
from
ExtensionClass
import
Base
from
ExtensionClass
import
Base
...
@@ -53,6 +53,8 @@ class Batch(Base):
...
@@ -53,6 +53,8 @@ class Batch(Base):
argument, is a 1-based index (I know, lame). "first" is the
argument, is a 1-based index (I know, lame). "first" is the
0-based index. "length" is the actual number of elements in
0-based index. "length" is the actual number of elements in
the batch.
the batch.
"total" is the length of the original, unbatched, sequence
'''
'''
start
=
start
+
1
start
=
start
+
1
...
@@ -68,6 +70,7 @@ class Batch(Base):
...
@@ -68,6 +70,7 @@ class Batch(Base):
self
.
overlap
=
overlap
self
.
overlap
=
overlap
self
.
first
=
max
(
start
-
1
,
0
)
self
.
first
=
max
(
start
-
1
,
0
)
self
.
length
=
self
.
end
-
self
.
first
self
.
length
=
self
.
end
-
self
.
first
self
.
total
=
len
(
sequence
)
if
self
.
first
==
0
:
if
self
.
first
==
0
:
self
.
previous
=
None
self
.
previous
=
None
...
...
lib/python/ZTUtils/CHANGES.txt
View file @
73592a00
...
@@ -4,6 +4,12 @@ ZTUtils changes
...
@@ -4,6 +4,12 @@ ZTUtils changes
Change information for previous versions can be found in the
Change information for previous versions can be found in the
file HISTORY.txt.
file HISTORY.txt.
After Version 1.1.3
Features Added
- Added useful 'total' attribute to batches.
Version 1.1.4
Version 1.1.4
Features Added
Features Added
...
...
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