fix symetric spelling
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 05 Feb 2010 09:34:43 +0100
changeset 484 a8de3bb314ef
parent 483 c39da0ebf38a
child 485 2c1a08b9cabc
fix symetric spelling
nodes.py
stcheck.py
test/unittest_analyze.py
test/unittest_stcheck.py
--- a/nodes.py	Fri Feb 05 09:15:47 2010 +0100
+++ b/nodes.py	Fri Feb 05 09:34:43 2010 +0100
@@ -906,7 +906,7 @@
                 if mainindex in lhsvar.stinfo['selected']:
                     return tr(rtype)
                 if mainindex in rhsvar.stinfo['selected']:
-                    if schema is not None and rschema.symetric:
+                    if schema is not None and rschema.symmetric:
                         return tr(rtype)
                     return tr(rtype + '_object')
             if rhsvar is self:
--- a/stcheck.py	Fri Feb 05 09:15:47 2010 +0100
+++ b/stcheck.py	Fri Feb 05 09:34:43 2010 +0100
@@ -34,7 +34,7 @@
     """Check a RQL syntax tree for errors not detected on parsing.
 
     Some simple rewriting of the tree may be done too:
-    * if a OR is used on a symetric relation
+    * if a OR is used on a symmetric relation
     * IN function with a single child
 
     use assertions for internal error but specific `BadRQLQuery` exception for
@@ -236,14 +236,14 @@
 
     def visit_or(self, ou, errors):
         #assert len(ou.children) == 2, len(ou.children)
-        # simplify Ored expression of a symetric relation
+        # simplify Ored expression of a symmetric relation
         r1, r2 = ou.children[0], ou.children[1]
         try:
             r1type = r1.r_type
             r2type = r2.r_type
         except AttributeError:
             return # can't be
-        if r1type == r2type and self.schema.rschema(r1type).symetric:
+        if r1type == r2type and self.schema.rschema(r1type).symmetric:
             lhs1, rhs1 = r1.get_variable_parts()
             lhs2, rhs2 = r2.get_variable_parts()
             try:
--- a/test/unittest_analyze.py	Fri Feb 05 09:15:47 2010 +0100
+++ b/test/unittest_analyze.py	Fri Feb 05 09:34:43 2010 +0100
@@ -18,7 +18,7 @@
 
 
 class RelationSchema(ERSchema):
-    def __init__(self, assoc_types, symetric=False, card=None):
+    def __init__(self, assoc_types, symmetric=False, card=None):
         self.assoc_types = assoc_types
         self.subj_types = [e_type[0] for e_type in assoc_types]
         self.final = False
@@ -29,7 +29,7 @@
                 if e_type in ('Int', 'Datetime', 'String'):
                     self.final = True
         self.obj_types = d.keys()
-        self.symetric = symetric
+        self.symmetric = symmetric
         self.inlined = False
         if card is None:
             if self.final:
@@ -124,7 +124,7 @@
                                          ('Student', ('Student',) ),
                                          ('Person', ('Student',) ),
                                          ),
-                                        symetric=True),
+                                        symmetric=True),
             'located' : RelationSchema( ( ('Person', ('Address',) ),
                                           ('Student', ('Address',) ),
                                           ('Company', ('Address',) ),
@@ -416,7 +416,7 @@
         sols = sorted(node.children[0].solutions)
         self.assertEqual(sols, [{'E1': 'Company'}])
 
-    def test_not_symetric_relation_eid(self):
+    def test_not_symmetric_relation_eid(self):
         node = self.helper.parse('Any P WHERE X eid 0, NOT X connait P')
         self.helper.compute_solutions(node, debug=DEBUG)
         sols = sorted(node.children[0].solutions)
--- a/test/unittest_stcheck.py	Fri Feb 05 09:15:47 2010 +0100
+++ b/test/unittest_stcheck.py	Fri Feb 05 09:34:43 2010 +0100
@@ -108,7 +108,7 @@
 # no more supported, use outerjoin explicitly
 #            ('Any X,Y WHERE X work_for Y OR NOT X work_for Y', 'Any X,Y WHERE X? work_for Y?'),
 #            ('Any X,Y WHERE NOT X work_for Y OR X work_for Y', 'Any X,Y WHERE X? work_for Y?'),
-            # test symetric OR rewrite
+            # test symmetric OR rewrite
             ("DISTINCT Any P WHERE P connait S OR S connait P, S name 'chouette'",
              "DISTINCT Any P WHERE P connait S, S name 'chouette'"),
             # queries that should not be rewritten