autopep8: fix E127 continuation line over-indented for visual indent
authorDenis Laxalde <denis.laxalde@logilab.fr>
Wed, 13 Feb 2019 12:31:03 +0100
changeset 827 88960edeba15
parent 826 c993c0593d6c
child 828 9a4d926f95cb
autopep8: fix E127 continuation line over-indented for visual indent
__pkginfo__.py
rql/stcheck.py
test/unittest_nodes.py
test/unittest_rqlgen.py
test/unittest_stcheck.py
--- a/__pkginfo__.py	Wed Feb 13 12:28:28 2019 +0100
+++ b/__pkginfo__.py	Wed Feb 13 12:31:03 2019 +0100
@@ -70,7 +70,7 @@
 if sys.platform != 'win32':
     ext_modules = [Extension('rql.rql_solve',
                              ['rql/gecode_solver.cpp'],
-                              libraries=['gecodeint', 'gecodekernel', 'gecodesearch',],
+                             libraries=['gecodeint', 'gecodekernel', 'gecodesearch',],
                              extra_compile_args=['-DGE_VERSION=%s' % GECODE_VERSION],
                          )
                    ]
--- a/rql/stcheck.py	Wed Feb 13 12:28:28 2019 +0100
+++ b/rql/stcheck.py	Wed Feb 13 12:31:03 2019 +0100
@@ -131,7 +131,7 @@
         for select in node.children[1:]:
             if not len(select.selection) == nbselected:
                 state.error('when using union, all subqueries should have '
-                              'the same number of selected terms')
+                            'the same number of selected terms')
     def leave_union(self, node, state):
         pass
 
@@ -150,8 +150,8 @@
                     state.add_var_info(vref.variable, VAR_SELECTED)
         for var in node.defined_vars.values():
             vinfo = state.var_info.get(var, 0)
-            if not (vinfo & VAR_HAS_REL) and (vinfo & VAR_HAS_TYPE_REL) \
-                   and not (vinfo & VAR_SELECTED):
+            if (not (vinfo & VAR_HAS_REL) and (vinfo & VAR_HAS_TYPE_REL)
+                    and not (vinfo & VAR_SELECTED)):
                 raise BadRQLQuery('unbound variable %s (%s)' % (var.name, selected))
         if node.groupby:
             # check that selected variables are used in groups
@@ -241,7 +241,7 @@
                     subvref = select.selection[i]
                 except IndexError:
                     state.error('subquery "%s" has only %s selected terms, needs %s'
-                                  % (select, len(select.selection), len(node.aliases)))
+                                % (select, len(select.selection), len(node.aliases)))
                     continue
                 if isinstance(subvref, VariableRef):
                     trmap[subvref.name] = vref.name
@@ -573,8 +573,8 @@
                 # partially processed
                 if rel in stinfo['rhsrelations']:
                     lhs, rhs = rel.get_parts()
-                    if vref is rhs.children[0] and \
-                           self.schema.rschema(rel.r_type).final:
+                    if (vref is rhs.children[0]
+                            and self.schema.rschema(rel.r_type).final):
                         update_attrvars(newvar, rel, lhs)
                         lhsvar = getattr(lhs, 'variable', None)
                         stinfo['attrvars'].remove((lhsvar, rel.r_type) )
--- a/test/unittest_nodes.py	Wed Feb 13 12:28:28 2019 +0100
+++ b/test/unittest_nodes.py	Wed Feb 13 12:31:03 2019 +0100
@@ -570,28 +570,28 @@
 
         tree = parse("Person X")
         self.assertEqual(tree.as_string(),
-                          'Any X WHERE X is Person')
+                         'Any X WHERE X is Person')
 
         tree = parse(u"Any X WHERE X has_text 'héhé'")
         self.assertEqual(tree.as_string(),
-                          u'Any X WHERE X has_text "héhé"')
+                         u'Any X WHERE X has_text "héhé"')
         tree = parse(u"Any X WHERE X has_text %(text)s")
         self.assertEqual(tree.as_string({'text': u'héhé'}),
-                          u'Any X WHERE X has_text "héhé"')
+                         u'Any X WHERE X has_text "héhé"')
         tree = parse(u"Any X WHERE X has_text %(text)s")
         self.assertEqual(tree.as_string({'text': u'hé"hé'}),
-                          u'Any X WHERE X has_text "hé\\"hé"')
+                         u'Any X WHERE X has_text "hé\\"hé"')
         tree = parse(u"Any X WHERE X has_text %(text)s")
         self.assertEqual(tree.as_string({'text': u'hé"\'hé'}),
-                          u'Any X WHERE X has_text "hé\\"\'hé"')
+                         u'Any X WHERE X has_text "hé\\"\'hé"')
 
     def test_as_string_no_encoding(self):
         tree = parse(u"Any X WHERE X has_text 'héhé'")
         self.assertEqual(tree.as_string(),
-                          u'Any X WHERE X has_text "héhé"')
+                         u'Any X WHERE X has_text "héhé"')
         tree = parse(u"Any X WHERE X has_text %(text)s")
         self.assertEqual(tree.as_string(kwargs={'text': u'héhé'}),
-                          u'Any X WHERE X has_text "héhé"')
+                         u'Any X WHERE X has_text "héhé"')
 
     def test_as_string_now_today_null(self):
         tree = parse(u"Any X WHERE X name NULL")
@@ -740,7 +740,7 @@
         for varref in varrefs:
             self.assertIsInstance(varref, nodes.VariableRef)
         self.assertEqual(sorted(x.name for x in varrefs),
-                          ['X', 'X', 'X', 'Y', 'Y'])
+                         ['X', 'X', 'X', 'Y', 'Y'])
 
     def test_iknown_values_1(self):
         tree = parse('Any X where X name "turlututu"').children[0]
@@ -756,7 +756,7 @@
         for varref in varrefs:
             self.assertIsInstance(varref, nodes.VariableRef)
         self.assertEqual(sorted(x.name for x in varrefs),
-                          ['X', 'X', 'X', 'Y', 'Y'])
+                         ['X', 'X', 'X', 'Y', 'Y'])
 
 
 if __name__ == '__main__':
--- a/test/unittest_rqlgen.py	Wed Feb 13 12:28:28 2019 +0100
+++ b/test/unittest_rqlgen.py	Wed Feb 13 12:31:03 2019 +0100
@@ -69,8 +69,8 @@
                                         ('X',),
                                         ('F ASC', 'S DESC'))
         self.assertEqual(rql, 'Person X\nWHERE X work_for S , S name "Logilab"'
-                          ' , X firstname F , X surname S\nGROUPBY X'
-                          '\nSORTBY F ASC, S DESC')
+                         ' , X firstname F , X surname S\nGROUPBY X'
+                         '\nSORTBY F ASC, S DESC')
                                         
         
     def test_where(self):
@@ -81,7 +81,7 @@
                                          ('X','firstname','F'),
                                          ('X','surname','S') ) )
         self.assertEqual(rql, 'WHERE X work_for S , S name "Logilab" '
-                          ', X firstname F , X surname S')
+                         ', X firstname F , X surname S')
 
 
     def test_groupby(self):
@@ -104,7 +104,7 @@
         rql = self.rql_generator.insert('Person', (('firstname', "Clark"),
                                                    ('lastname', "Kent")))
         self.assertEqual(rql, 'INSERT Person X: X firstname "Clark",'
-                          ' X lastname "Kent"')
+                         ' X lastname "Kent"')
         
         
     def test_update(self):
@@ -116,8 +116,8 @@
                                         (('job', "superhero"),
                                          ('nick', "superman")))
         self.assertEqual(rql, 'SET X job "superhero", X nick "superman" '
-                          'WHERE X is "Person", X firstname "Clark", X '
-                          'lastname "Kent"')
+                         'WHERE X is "Person", X firstname "Clark", X '
+                         'lastname "Kent"')
 
 
     def test_delete(self):
@@ -127,7 +127,7 @@
                                         (('firstname', "Clark"),
                                          ('lastname', "Kent")))
         self.assertEqual(rql, 'DELETE Person X where X firstname "Clark", '
-                          'X lastname "Kent"')
+                         'X lastname "Kent"')
         
 
 if __name__ == '__main__':
--- a/test/unittest_stcheck.py	Wed Feb 13 12:28:28 2019 +0100
+++ b/test/unittest_stcheck.py	Wed Feb 13 12:31:03 2019 +0100
@@ -202,10 +202,10 @@
                             'WITH VF, VC, VCD BEING (Any VF, MAX(VC), VCD GROUPBY VF, VCD '
                             '                        WHERE VC connait VF, VC creation_date VCD)'))
         self.assertEqual(rqlst.children[0].vargraph,
-                          {'VCD': ['VC'], 'VF': ['VC'], 'S': ['VC'], 'VC': ['S', 'VF', 'VCD'],
-                           ('VC', 'S'): 'work_for',
-                           ('VC', 'VF'): 'connait',
-                           ('VC', 'VCD'): 'creation_date'})
+                         {'VCD': ['VC'], 'VF': ['VC'], 'S': ['VC'], 'VC': ['S', 'VF', 'VCD'],
+                          ('VC', 'S'): 'work_for',
+                          ('VC', 'VF'): 'connait',
+                          ('VC', 'VCD'): 'creation_date'})
         self.assertEqual(rqlst.children[0].aggregated, set(('VC',)))