[Checkins] SVN: zc.relationship/branches/1.1/ Fix name errors. Thank you pyflakes

Martin Aspeli optilude at gmx.net
Mon Mar 16 12:57:33 EDT 2009


Log message for revision 98146:
  Fix name errors. Thank you pyflakes

Changed:
  U   zc.relationship/branches/1.1/CHANGES.txt
  U   zc.relationship/branches/1.1/setup.py
  U   zc.relationship/branches/1.1/src/zc/relationship/index.py
  U   zc.relationship/branches/1.1/src/zc/relationship/shared.py

-=-
Modified: zc.relationship/branches/1.1/CHANGES.txt
===================================================================
--- zc.relationship/branches/1.1/CHANGES.txt	2009-03-16 15:52:21 UTC (rev 98145)
+++ zc.relationship/branches/1.1/CHANGES.txt	2009-03-16 16:57:33 UTC (rev 98146)
@@ -7,6 +7,11 @@
 
 (supports Zope 3.4/Zope 2.11/ZODB 3.8)
 
+1.1.1
+-----
+
+- Fix name errors caught by pyflakes.
+
 1.1.0
 -----
 

Modified: zc.relationship/branches/1.1/setup.py
===================================================================
--- zc.relationship/branches/1.1/setup.py	2009-03-16 15:52:21 UTC (rev 98145)
+++ zc.relationship/branches/1.1/setup.py	2009-03-16 16:57:33 UTC (rev 98146)
@@ -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'},

Modified: zc.relationship/branches/1.1/src/zc/relationship/index.py
===================================================================
--- zc.relationship/branches/1.1/src/zc/relationship/index.py	2009-03-16 15:52:21 UTC (rev 98145)
+++ zc.relationship/branches/1.1/src/zc/relationship/index.py	2009-03-16 16:57:33 UTC (rev 98146)
@@ -1,6 +1,3 @@
-import re
-import types
-
 import persistent
 import persistent.interfaces
 from BTrees import OOBTree, IFBTree, IOBTree, Length
@@ -119,7 +116,7 @@
             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)
@@ -356,7 +353,7 @@
     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)
 
@@ -483,7 +480,7 @@
                         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,

Modified: zc.relationship/branches/1.1/src/zc/relationship/shared.py
===================================================================
--- zc.relationship/branches/1.1/src/zc/relationship/shared.py	2009-03-16 15:52:21 UTC (rev 98145)
+++ zc.relationship/branches/1.1/src/zc/relationship/shared.py	2009-03-16 16:57:33 UTC (rev 98146)
@@ -190,7 +190,7 @@
         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,



More information about the Checkins mailing list