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
8a854815
Commit
8a854815
authored
Apr 20, 2004
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zLOG -> logging
parent
9d2ed629
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
44 deletions
+40
-44
lib/python/Products/PluginIndexes/KeywordIndex/KeywordIndex.py
...ython/Products/PluginIndexes/KeywordIndex/KeywordIndex.py
+5
-4
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
+5
-5
lib/python/Products/PluginIndexes/TopicIndex/FilteredSet.py
lib/python/Products/PluginIndexes/TopicIndex/FilteredSet.py
+8
-12
lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py
lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py
+6
-5
lib/python/Products/PluginIndexes/common/UnIndex.py
lib/python/Products/PluginIndexes/common/UnIndex.py
+16
-18
No files found.
lib/python/Products/PluginIndexes/KeywordIndex/KeywordIndex.py
View file @
8a854815
...
...
@@ -12,8 +12,7 @@
##############################################################################
from
types
import
StringType
,
UnicodeType
from
zLOG
import
LOG
,
ERROR
from
logging
import
getLogger
from
BTrees.OOBTree
import
OOSet
,
difference
from
Globals
import
DTMLFile
...
...
@@ -22,6 +21,8 @@ from Products.PluginIndexes import PluggableIndex
from
Products.PluginIndexes.common.UnIndex
import
UnIndex
from
Products.PluginIndexes.common
import
safe_callable
LOG
=
getLogger
(
'Zope.KeywordIndex'
)
class
KeywordIndex
(
UnIndex
):
__implements__
=
(
PluggableIndex
.
UniqueValueIndex
,
...
...
@@ -121,8 +122,8 @@ class KeywordIndex(UnIndex):
try
:
del
self
.
_unindex
[
documentId
]
except
KeyError
:
LOG
(
'UnKeywordIndex'
,
ERROR
,
'Attempt to unindex nonexistent'
' document id %s'
%
documentId
)
LOG
.
error
(
'Attempt to unindex nonexistent'
' document id %s'
%
documentId
)
index_html
=
DTMLFile
(
'dtml/index'
,
globals
())
...
...
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
View file @
8a854815
...
...
@@ -11,9 +11,10 @@
#
##############################################################################
__version__
=
'$Id: PathIndex.py,v 1.4
0 2004/01/24 15:48:38
andreasjung Exp $'
__version__
=
'$Id: PathIndex.py,v 1.4
1 2004/04/20 14:30:44
andreasjung Exp $'
from
types
import
StringType
,
ListType
,
TupleType
from
logging
import
getLogger
from
Globals
import
Persistent
,
DTMLFile
from
OFS.SimpleItem
import
SimpleItem
...
...
@@ -21,13 +22,13 @@ from BTrees.IOBTree import IOBTree
from
BTrees.OOBTree
import
OOBTree
from
BTrees.IIBTree
import
IITreeSet
,
IISet
,
intersection
,
union
from
BTrees.Length
import
Length
from
zLOG
import
LOG
,
ERROR
from
Products.PluginIndexes
import
PluggableIndex
from
Products.PluginIndexes.common.util
import
parseIndexRequest
from
Products.PluginIndexes.common
import
safe_callable
_marker
=
[]
LOG
=
getLogger
(
'Zope.PathIndex'
)
class
PathIndex
(
Persistent
,
SimpleItem
):
""" A path index stores all path components of the physical
...
...
@@ -124,9 +125,8 @@ class PathIndex(Persistent, SimpleItem):
""" hook for (Z)Catalog """
if
not
self
.
_unindex
.
has_key
(
docid
):
LOG
(
self
.
__class__
.
__name__
,
ERROR
,
'Attempt to unindex nonexistent document'
' with id %s'
%
docid
)
LOG
.
error
(
'Attempt to unindex nonexistent document'
' with id %s'
%
docid
)
return
comps
=
self
.
_unindex
[
docid
].
split
(
'/'
)
...
...
lib/python/Products/PluginIndexes/TopicIndex/FilteredSet.py
View file @
8a854815
...
...
@@ -11,16 +11,19 @@
#
##############################################################################
__version__
=
'$Id: FilteredSet.py,v 1.7 2004/01/15 23:17:17 tseaver Exp $'
__version__
=
'$Id: FilteredSet.py,v 1.8 2004/04/20 14:30:45 andreasjung Exp $'
import
sys
from
logging
import
getLogger
from
ZODB.POSException
import
ConflictError
from
BTrees.IIBTree
import
IITreeSet
from
Persistence
import
Persistent
from
Globals
import
DTMLFile
from
zLOG
import
WARNING
,
LOG
from
RestrictedPython.Eval
import
RestrictionCapableEval
import
sys
LOG
=
getLogger
(
'Zope.TopicIndex.FilteredSet'
)
class
FilteredSetBase
(
Persistent
):
...
...
@@ -29,20 +32,16 @@ class FilteredSetBase(Persistent):
self
.
expr
=
expr
self
.
clear
()
def
clear
(
self
):
self
.
ids
=
IITreeSet
()
def
index_object
(
self
,
documentId
,
obj
):
raise
RuntimeError
,
'index_object not defined'
def
unindex_object
(
self
,
documentId
):
try
:
self
.
ids
.
remove
(
documentId
)
except
KeyError
:
pass
def
getId
(
self
):
return
self
.
id
...
...
@@ -63,7 +62,6 @@ class FilteredSetBase(Persistent):
__str__
=
__repr__
class
PythonFilteredSet
(
FilteredSetBase
):
meta_type
=
'PythonFilteredSet'
...
...
@@ -80,10 +78,8 @@ class PythonFilteredSet(FilteredSetBase):
except
ConflictError
:
raise
except
:
LOG
(
'FilteredSet'
,
WARNING
,
'eval() failed'
,
\
'Object: %s, expr: %s'
%
(
o
.
getId
(),
self
.
expr
),
\
sys
.
exc_info
())
LOG
.
warn
(
'eval() failed Object: %s, expr: %s'
%
\
(
o
.
getId
(),
self
.
expr
),
exc_info
=
sys
.
exc_info
())
def
factory
(
f_id
,
f_type
,
expr
):
...
...
lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py
View file @
8a854815
...
...
@@ -11,11 +11,12 @@
#
##############################################################################
__version__
=
'$Id: TopicIndex.py,v 1.17 2003/12/31 22:32:21 poster Exp $'
__version__
=
'$Id: TopicIndex.py,v 1.18 2004/04/20 14:30:45 andreasjung Exp $'
from
logging
import
getLogger
from
Globals
import
Persistent
,
DTMLFile
from
OFS.SimpleItem
import
SimpleItem
from
zLOG
import
ERROR
,
LOG
from
BTrees.OOBTree
import
OOBTree
from
BTrees.IIBTree
import
IITreeSet
,
intersection
,
union
...
...
@@ -24,6 +25,7 @@ from Products.PluginIndexes import PluggableIndex
from
Products.PluginIndexes.common.util
import
parseIndexRequest
_marker
=
[]
LOG
=
getLogger
(
'Zope.TopicIndex'
)
class
TopicIndex
(
Persistent
,
SimpleItem
):
...
...
@@ -69,9 +71,8 @@ class TopicIndex(Persistent, SimpleItem):
try
:
fs
.
unindex_object
(
docid
)
except
KeyError
:
LOG
(
self
.
__class__
.
__name__
,
ERROR
,
'Attempt to unindex document'
' with id %s failed'
%
docid
)
LOG
.
error
(
'Attempt to unindex document'
' with id %s failed'
%
docid
)
return
1
def
numObjects
(
self
):
...
...
lib/python/Products/PluginIndexes/common/UnIndex.py
View file @
8a854815
...
...
@@ -13,15 +13,15 @@
"""Simple column indices"""
__version__
=
'$Revision: 1.2
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
2
$'
[
11
:
-
2
]
import
sys
from
cgi
import
escape
from
logging
import
getLogger
from
types
import
StringType
,
ListType
,
IntType
,
TupleType
from
Globals
import
Persistent
from
Acquisition
import
Implicit
from
zLOG
import
LOG
,
ERROR
from
BTrees.OOBTree
import
OOBTree
,
OOSet
from
BTrees.IOBTree
import
IOBTree
...
...
@@ -32,8 +32,8 @@ import BTrees.Length
from
Products.PluginIndexes.common.util
import
parseIndexRequest
from
Products.PluginIndexes.common
import
safe_callable
_marker
=
[]
LOG
=
getLogger
(
'Zope.UnIndex'
)
class
UnIndex
(
Persistent
,
Implicit
,
SimpleItem
):
"""UnIndex object interface"""
...
...
@@ -202,17 +202,16 @@ class UnIndex(Persistent, Implicit, SimpleItem):
try
:
self
.
__len__
.
change
(
-
1
)
except
AttributeError
:
pass
# pre-BTrees-module instance
except
:
LOG
(
self
.
__class__
.
__name__
,
ERROR
,
(
'unindex_object could not remove '
'documentId %s from index %s. This '
'should not happen.'
%
(
str
(
documentId
),
str
(
self
.
id
))),
''
,
sys
.
exc_info
())
LOG
.
error
(
'%s: unindex_object could not remove '
'documentId %s from index %s. This '
'should not happen.'
%
(
self
.
__class__
.
__name__
,
str
(
documentId
),
str
(
self
.
id
)),
exc_info
=
sys
.
exc_info
())
else
:
LOG
(
self
.
__class__
.
__name__
,
ERROR
,
(
'unindex_object tried to retrieve set %
s '
'from index %s but couldn
\
'
t. This '
'should not happen.'
%
(
repr
(
entry
),
str
(
self
.
id
)
)))
LOG
.
error
(
'%s: unindex_object tried to retrieve set %s '
'from index %s but couldn
\
'
t. Thi
s '
'should not happen.'
%
(
self
.
__class__
.
__name__
,
repr
(
entry
),
str
(
self
.
id
)))
def
insertForwardIndexEntry
(
self
,
entry
,
documentId
):
...
...
@@ -269,9 +268,8 @@ class UnIndex(Persistent, Implicit, SimpleItem):
try
:
del
self
.
_unindex
[
documentId
]
except
:
LOG
(
'UnIndex'
,
ERROR
,
'Should not happen: oldDatum was there, now its not,'
'for document with id %s'
%
documentId
)
LOG
.
error
(
'Should not happen: oldDatum was there, now its not,'
'for document with id %s'
%
documentId
)
if
datum
is
not
_marker
:
self
.
insertForwardIndexEntry
(
datum
,
documentId
)
...
...
@@ -312,8 +310,8 @@ class UnIndex(Persistent, Implicit, SimpleItem):
try
:
del
self
.
_unindex
[
documentId
]
except
:
LOG
(
'UnIndex'
,
ERROR
,
'Attempt to unindex nonexistent document'
' with id %s'
%
documentId
)
LOG
.
error
(
'Attempt to unindex nonexistent document'
' with id %s'
%
documentId
)
def
_apply_index
(
self
,
request
,
cid
=
''
,
type
=
type
):
"""Apply the index to query parameters given in the request arg.
...
...
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