Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
... which came with the new flake8 version.

modified:   src/Products/PluginIndexes/CompositeIndex/tests/testCompositeIndex.py
modified:   src/Products/ZCTextIndex/BaseIndex.py
modified:   src/Products/ZCTextIndex/RiceCode.py
modified:   src/Products/ZCatalog/ZCatalog.py
  • Loading branch information
jugmac00 committed May 19, 2020
1 parent bf97828 commit c4b1a6b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,12 @@ def profileSearch(query, warmup=False, verbose=False):
len(res1), len(res2), query))
self.assertEqual(res1, res2)

for l in lengths:
for length in lengths:
self.clearIndexes()
logger.info('************************************\n'
'indexing %s objects', l)
'indexing %s objects', length)

for i in range(l):
for i in range(length):
name = str(i)
obj = RandomTestObject(name)
self.populateIndexes(i, obj)
Expand Down
2 changes: 1 addition & 1 deletion src/Products/ZCTextIndex/BaseIndex.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def scaled_int(f, scale=SCALE_FACTOR):
return int(f * scale + 0.5)


def unique(l):
def unique(l): # noqa: E741
"""Return a list of the unique elements in l."""
return IITreeSet(l).keys()

Expand Down
4 changes: 2 additions & 2 deletions src/Products/ZCTextIndex/RiceCode.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ def __setstate__(self, value):
self.bits = bits


def encode(m, l):
def encode(m, l): # noqa: E741
c = RiceCode(m)
for elt in l:
c.append(elt)
assert c.tolist() == l
return c


def encode_deltas(l):
def encode_deltas(l): # noqa: E741
if len(l) == 1:
return l[0], []
deltas = RiceCode(6)
Expand Down
5 changes: 2 additions & 3 deletions src/Products/ZCatalog/ZCatalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,8 @@ def ZopeFindAndApply(self, obj, obj_ids=None, obj_metatypes=None,
or expr_match(ob, obj_expr))
and (not obj_mtime
or mtime_match(ob, obj_mtime, obj_mspec))
and ((not obj_permission
or not obj_roles)
or role_match(ob, obj_permission, obj_roles))):
and ((not obj_permission or not obj_roles)
or role_match(ob, obj_permission, obj_roles))):
if apply_func:
apply_func(ob, (apply_path + '/' + p))
else:
Expand Down

0 comments on commit c4b1a6b

Please sign in to comment.