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
c1c0aec4
Commit
c1c0aec4
authored
Aug 28, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added optional level parameter on per-path basis
parent
dcd0edca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
doc/CHANGES.txt
doc/CHANGES.txt
+7
-0
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
+13
-3
No files found.
doc/CHANGES.txt
View file @
c1c0aec4
...
...
@@ -63,6 +63,13 @@ Zope Changes
then HTTP version could not be determined from the HTTP request.
Now sending "HTTP/1.0..."
- queries for the PathIndex can now specified as tuple (path,level).
the level parameter inside a query overrides the optional
'level' parameter for a complete search request.
Zope 2.4 beta 2
Bugs fixed
...
...
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
View file @
c1c0aec4
...
...
@@ -83,7 +83,7 @@
#
##############################################################################
__version__
=
'$Id: PathIndex.py,v 1.
4 2001/06/01 18:53:39 andreas
Exp $'
__version__
=
'$Id: PathIndex.py,v 1.
5 2001/08/28 01:05:31 andreasjung
Exp $'
from
Products.PluginIndexes
import
PluggableIndex
from
Products.PluginIndexes.common.util
import
parseIndexRequest
...
...
@@ -97,6 +97,7 @@ from BTrees.IOBTree import IOBTree
from
BTrees.OOBTree
import
OOBTree
,
OOSet
from
BTrees.OIBTree
import
OIBTree
from
BTrees.IIBTree
import
IISet
,
difference
,
intersection
,
union
from
types
import
StringType
import
re
...
...
@@ -233,13 +234,22 @@ class PathIndex(PluggableIndex.PluggableIndex, Persistent,
return
comps
def
search
(
self
,
path
,
level
=
0
):
def
search
(
self
,
path
,
default_
level
=
0
):
"""
path is a list of path components to be searched
path is either a string representing a
relative URL or a part of a relative URL or
a tuple (path,level).
level>=0 starts searching at the given level
level<0 not implemented yet
"""
if
isinstance
(
path
,
StringType
):
level
=
default_level
else
:
level
=
path
[
1
]
path
=
path
[
0
]
comps
=
self
.
splitPath
(
path
)
...
...
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