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
2782245f
Commit
2782245f
authored
Nov 24, 2004
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- cleanup: removed unnecessary 'global' statement + very old migration code
parent
5ffc0bd2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
35 deletions
+1
-35
lib/python/Products/PluginIndexes/common/UnIndex.py
lib/python/Products/PluginIndexes/common/UnIndex.py
+1
-35
No files found.
lib/python/Products/PluginIndexes/common/UnIndex.py
View file @
2782245f
...
...
@@ -17,7 +17,7 @@ $Id$"""
import
sys
from
cgi
import
escape
from
logging
import
getLogger
from
types
import
StringType
,
ListType
,
IntType
,
Tuple
Type
from
types
import
Int
Type
from
BTrees.OOBTree
import
OOBTree
,
OOSet
from
BTrees.IOBTree
import
IOBTree
...
...
@@ -115,35 +115,6 @@ class UnIndex(SimpleItem):
self
.
_index
=
OOBTree
()
self
.
_unindex
=
IOBTree
()
def
_convertBTrees
(
self
,
threshold
=
200
):
if
type
(
self
.
_index
)
is
OOBTree
:
return
from
BTrees.convert
import
convert
_index
=
self
.
_index
self
.
_index
=
OOBTree
()
def
convertSet
(
s
,
IITreeSet
=
IITreeSet
,
IntType
=
type
(
0
),
type
=
type
,
len
=
len
,
doneTypes
=
(
IntType
,
IITreeSet
)):
if
type
(
s
)
in
doneTypes
:
return
s
if
len
(
s
)
==
1
:
try
:
return
s
[
0
]
# convert to int
except
:
pass
# This is just an optimization.
return
IITreeSet
(
s
)
convert
(
_index
,
self
.
_index
,
threshold
,
convertSet
)
_unindex
=
self
.
_unindex
self
.
_unindex
=
IOBTree
()
convert
(
_unindex
,
self
.
_unindex
,
threshold
)
self
.
__len__
=
BTrees
.
Length
.
Length
(
len
(
_index
))
def
__nonzero__
(
self
):
return
not
not
self
.
_unindex
...
...
@@ -162,7 +133,6 @@ class UnIndex(SimpleItem):
return
histogram
def
referencedObjects
(
self
):
"""Generate a list of IDs for which we have referenced objects."""
return
self
.
_unindex
.
keys
()
...
...
@@ -182,7 +152,6 @@ class UnIndex(SimpleItem):
"""Take the entry provided and remove any reference to documentId
in its entry in the index.
"""
global
_marker
indexRow
=
self
.
_index
.
get
(
entry
,
_marker
)
if
indexRow
is
not
_marker
:
try
:
...
...
@@ -215,7 +184,6 @@ class UnIndex(SimpleItem):
This will also deal with creating the entire row if necessary.
"""
global
_marker
indexRow
=
self
.
_index
.
get
(
entry
,
_marker
)
# Make sure there's actually a row there already. If not, create
...
...
@@ -248,7 +216,6 @@ class UnIndex(SimpleItem):
def
_index_object
(
self
,
documentId
,
obj
,
threshold
=
None
,
attr
=
''
):
""" index and object 'obj' with integer id 'documentId'"""
global
_marker
returnStatus
=
0
# First we need to see if there's anything interesting to look at
...
...
@@ -296,7 +263,6 @@ class UnIndex(SimpleItem):
""" Unindex the object with integer id 'documentId' and don't
raise an exception if we fail
"""
global
_marker
unindexRecord
=
self
.
_unindex
.
get
(
documentId
,
_marker
)
if
unindexRecord
is
_marker
:
return
None
...
...
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