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
b493e7f2
Commit
b493e7f2
authored
Nov 13, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed 'batch-size' crap (not used inside Zope)
parent
e2c73f8b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
6 deletions
+43
-6
lib/python/Products/ZCatalog/Catalog.py
lib/python/Products/ZCatalog/Catalog.py
+43
-6
No files found.
lib/python/Products/ZCatalog/Catalog.py
View file @
b493e7f2
...
...
@@ -622,12 +622,6 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
kw
=
m
elif
REQUEST
:
kw
=
REQUEST
# Make sure batch size is set
if
REQUEST
and
not
REQUEST
.
has_key
(
'batch_size'
):
try
:
batch_size
=
self
.
default_batch_size
except
AttributeError
:
batch_size
=
20
REQUEST
[
'batch_size'
]
=
batch_size
# Compute "sort_index", which is a sort index, or none:
if
kw
.
has_key
(
'sort-on'
):
sort_index
=
kw
[
'sort-on'
]
...
...
@@ -682,4 +676,47 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
__call__
=
searchResults
def
checkConsistency
(
self
):
""" perform some consistency checks on the catalog """
from
types
import
IntType
from
BTrees.IIBTree
import
IISet
,
difference
,
intersection
l_data
=
list
(
self
.
data
.
keys
())
l_data
.
sort
()
l_uids
=
list
(
self
.
uids
.
values
())
l_uids
.
sort
()
l_paths
=
list
(
self
.
data
.
keys
())
l_paths
.
sort
()
assert
l_data
==
l_uids
assert
l_data
==
l_paths
for
id
,
idx
in
self
.
indexes
.
items
():
if
idx
.
meta_type
==
'FieldIndex'
:
RIDS
=
IISet
()
for
key
,
rids
in
idx
.
_index
.
items
():
if
isinstance
(
rids
,
IntType
):
RIDS
.
insert
(
rids
)
else
:
map
(
RIDS
.
insert
,
rids
.
keys
())
diff
=
difference
(
RIDS
,
IISet
(
self
.
data
.
keys
()))
assert
len
(
diff
)
==
0
,
'Index %s: problem with forward entries'
%
id
RIDS
=
IISet
()
for
key
,
rids
in
idx
.
_index
.
items
():
if
isinstance
(
rids
,
IntType
):
RIDS
.
insert
(
rids
)
else
:
map
(
RIDS
.
insert
,
rids
.
keys
())
diff
=
difference
(
RIDS
,
IISet
(
self
.
data
.
keys
()))
assert
len
(
diff
)
==
0
,
'Index %s: problems with backward entries'
%
id
class
CatalogError
(
Exception
):
pass
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