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
2a104988
Commit
2a104988
authored
Dec 14, 1998
by
Jeffrey Shell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unique values listing now won't return empty strings
parent
181ed4ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
lib/python/SearchIndex/Index.py
lib/python/SearchIndex/Index.py
+19
-4
No files found.
lib/python/SearchIndex/Index.py
View file @
2a104988
...
...
@@ -10,8 +10,8 @@
__doc__
=
'''Simple column indexes
$Id: Index.py,v 1.1
5 1998/10/13 21:07:17
jeffrey Exp $'''
__version__
=
'$Revision: 1.1
5
$'
[
11
:
-
2
]
$Id: Index.py,v 1.1
6 1998/12/14 16:32:55
jeffrey Exp $'''
__version__
=
'$Revision: 1.1
6
$'
[
11
:
-
2
]
from
Globals
import
Persistent
from
BTree
import
BTree
...
...
@@ -21,6 +21,15 @@ from Missing import MV
import
string
ListType
=
type
([])
StringType
=
type
(
's'
)
def
nonEmpty
(
s
):
"returns true if a non-empty string or any other (nonstring) type"
if
type
(
s
)
is
StringType
:
if
s
:
return
1
else
:
return
0
else
:
return
1
class
Index
(
Persistent
):
"""Index object interface"""
...
...
@@ -63,11 +72,14 @@ class Index(Persistent):
name
=
self
.
id
elif
name
!=
self
.
id
:
return
[]
if
not
withLengths
:
return
tuple
(
self
.
_index
.
keys
())
if
not
withLengths
:
return
tuple
(
filter
(
nonEmpty
,
self
.
_index
.
keys
())
)
else
:
rl
=
[]
for
i
in
self
.
_index
.
keys
():
rl
.
append
((
i
,
len
(
self
.
_index
[
i
])))
if
not
nonEmpty
(
i
):
continue
else
:
rl
.
append
((
i
,
len
(
self
.
_index
[
i
])))
return
tuple
(
rl
)
def
clear
(
self
):
...
...
@@ -206,6 +218,9 @@ class Index(Persistent):
##############################################################################
#
# $Log: Index.py,v $
# Revision 1.16 1998/12/14 16:32:55 jeffrey
# unique values listing now won't return empty strings
#
# Revision 1.15 1998/10/13 21:07:17 jeffrey
# added dpUniqueValues and dpHasUniqueValuesFor methods
#
...
...
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