cleanup stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 20 Jan 2010 11:29:08 +0100
branchstable
changeset 4287 15499a46c009
parent 4286 6801093af29c
child 4288 1c85c916fa13
child 4289 890dc89516f1
cleanup
server/rqlannotation.py
--- a/server/rqlannotation.py	Wed Jan 20 11:29:00 2010 +0100
+++ b/server/rqlannotation.py	Wed Jan 20 11:29:08 2010 +0100
@@ -189,7 +189,6 @@
             return rel
         principal = rel
     if principal is None:
-        print iter(relations).next().root
         raise BadRQLQuery('unable to find principal in %s' % ', '.join(
             r.as_string() for r in relations))
     return principal
@@ -310,7 +309,7 @@
         # apply relation restriction
         self.maydeambrels = maydeambrels = {}
         for rel in rqlst.iget_nodes(Relation):
-            if rel.is_types_restriction() or rel.r_type == 'eid':
+            if rel.r_type == 'eid' or rel.is_types_restriction():
                 continue
             lhs, rhs = rel.get_variable_parts()
             if isinstance(lhs, VariableRef) or isinstance(rhs, VariableRef):
@@ -385,9 +384,8 @@
             for otheretype in otheretypes:
                 reltypes = frozenset(rtypefunc(otheretype))
                 if var.stinfo['possibletypes'] != reltypes:
-                    break
-            else:
-                self.restrict(var, var.stinfo['possibletypes'])
-                self.deambification_map[var] = deambiguifier
-                return True
+                    return False
+            self.restrict(var, var.stinfo['possibletypes'])
+            self.deambification_map[var] = deambiguifier
+            return True
         return False