Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Jan 3, 2012
1 parent 5f30d0c commit 00ba1cb
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Products/ExtendedPathIndex/ExtendedPathIndex.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ExtendedPathIndex(PathIndex):

meta_type = "ExtendedPathIndex"

manage_options= (
manage_options = (
{'label': 'Settings', 'action': 'manage_main'},
)

Expand Down Expand Up @@ -117,7 +117,7 @@ def index_object(self, docid, obj, threshold=100):
self.insertEntry(comp, docid, i)

# Add terminator
self.insertEntry(None, docid, len(comps)-1)
self.insertEntry(None, docid, len(comps) - 1)

# Add full-path indexes, to optimize certain edge cases
parent_path = '/' + '/'.join(comps[:-1])
Expand Down Expand Up @@ -219,7 +219,7 @@ def search(self, path, default_level=0, depth=-1, navtree=0,

comps = filter(None, path.split('/'))

if navtree and depth == -1: # Navtrees don't do recursive
if navtree and depth == -1: # Navtrees don't do recursive
depth = 1

# Optimizations
Expand Down Expand Up @@ -283,8 +283,8 @@ def search(self, path, default_level=0, depth=-1, navtree=0,

# Core application of the indexes

pathset = resultset # Either None or passed in resultset
depthset = None # For limiting depth
pathset = resultset # Either None or passed in resultset
depthset = None # For limiting depth

if navtree and depth > 0:
# Include the elements up to the matching path
Expand All @@ -305,7 +305,8 @@ def search(self, path, default_level=0, depth=-1, navtree=0,
for i, comp in indexedcomps:
# Find all paths that have comp at the given level
res = self._index.get(comp, {}).get(i + level)
if res is None: # Non-existing path; navtree is inverse, keep going
if res is None:
# Non-existing path; navtree is inverse, keep going
pathset = IISet()
if not navtree:
return pathset
Expand Down Expand Up @@ -336,12 +337,12 @@ def _apply_index(self, request, resultset=None):
"""

record = parseIndexRequest(request, self.id, self.query_options)
if record.keys==None:
if record.keys == None:
return None

level = record.get("level", 0)
operator = record.get('operator', self.useOperator).lower()
depth = getattr(record, 'depth', -1) # use getattr to get 0 value
depth = getattr(record, 'depth', -1) # use getattr to get 0 value
navtree = record.get('navtree', 0)
navtree_start = record.get('navtree_start', 0)

Expand Down

0 comments on commit 00ba1cb

Please sign in to comment.