Skip to content

Commit

Permalink
Fix name errors. Thank you pyflakes
Browse files Browse the repository at this point in the history
  • Loading branch information
optilude committed Mar 16, 2009
1 parent 5af906a commit a4cfc29
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ CHANGES

(supports Zope 3.4/Zope 2.11/ZODB 3.8)

1.1.1
-----

- Fix name errors caught by pyflakes.

1.1.0
-----

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="zc.relationship",
version="1.1",
version="1.1.1",
packages=find_packages('src'),
include_package_data=True,
package_dir= {'':'src'},
Expand Down
9 changes: 3 additions & 6 deletions src/zc/relationship/index.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import re
import types

import persistent
import persistent.interfaces
from BTrees import OOBTree, IFBTree, IOBTree, Length
Expand Down Expand Up @@ -119,7 +116,7 @@ def __init__(self, attrs, defaultTransitiveQueriesFactory=None,
res['attrname'] = val.__name__
res['name'] = data.get('name', res['attrname'])
if res['name'] in _attrs or val in seen:
raise ValueError('Duplicate in attrs', name, val)
raise ValueError('Duplicate in attrs', res['name'], val)
seen.add(val)
_attrs[res['name']] = res
res['dump'] = data.get('dump', generateToken)
Expand Down Expand Up @@ -356,7 +353,7 @@ def tokenizeValues(self, values, name):
def resolveValueTokens(self, tokens, name):
load = self._attrs[name]['load']
if load is None:
return values
return tokens
cache = {}
return (load(t, self, cache) for t in tokens)

Expand Down Expand Up @@ -483,7 +480,7 @@ def findValueTokens(self, resultName, query, maxDepth=None, filter=None,
targetQuery=None, targetFilter=None,
transitiveQueriesFactory=None):
if resultName not in self._attrs:
raise ValueError('name not indexed', nm)
raise ValueError('name not indexed', resultName)
return self._yieldValueTokens(
resultName, *self._parse(
query, maxDepth, filter, targetQuery, targetFilter,
Expand Down
2 changes: 1 addition & 1 deletion src/zc/relationship/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def minDepthFilter(depth):
return None
if not isinstance(depth, (int, long)) or depth < 1:
raise ValueError('invalid minDepth', depth)
return lambda relchain, query, index, cache: len(relchain) >= minDepth
return lambda relchain, query, index, cache: len(relchain) >= depth

class AbstractContainer(persistent.Persistent):
def __init__(self,
Expand Down

0 comments on commit a4cfc29

Please sign in to comment.