autopep8: fix E303 too many blank lines
authorDenis Laxalde <denis.laxalde@logilab.fr>
Wed, 13 Feb 2019 12:31:37 +0100
changeset 828 9a4d926f95cb
parent 827 88960edeba15
child 829 7fc7aed2c0b2
autopep8: fix E303 too many blank lines
rql/__init__.py
rql/analyze.py
rql/compare.py
rql/nodes.py
rql/parser.py
rql/rqlgen.py
rql/stcheck.py
rql/utils.py
test/unittest_analyze.py
test/unittest_editextensions.py
test/unittest_nodes.py
test/unittest_rqlgen.py
--- a/rql/__init__.py	Wed Feb 13 12:31:03 2019 +0100
+++ b/rql/__init__.py	Wed Feb 13 12:31:37 2019 +0100
@@ -221,7 +221,6 @@
                     template = " %%%ii: %%s" % width
                     rqlstring = '\n'.join(template % (idx + 1, line) for idx, line in enumerate(multi_lines_rql))
 
-
                 msg = '%s\nat: %r\n%s' % (rqlstring, ex.pos,  ex.msg)
             else:
                 msg = '%s\n%s' % (rqlstring, ex.msg)
--- a/rql/analyze.py	Wed Feb 13 12:31:03 2019 +0100
+++ b/rql/analyze.py	Wed Feb 13 12:31:37 2019 +0100
@@ -177,7 +177,6 @@
         print("Variables:", self.variables)
         print("Values:", self.values)
 
-
     def pretty_print_ops(self, ops):
         if ops[0] in (_AND, _OR):
             res = [OPSYM[ops[0]], '(' ]
--- a/rql/compare.py	Wed Feb 13 12:31:03 2019 +0100
+++ b/rql/compare.py	Wed Feb 13 12:31:37 2019 +0100
@@ -169,13 +169,11 @@
             var = var.variable
             canon['all_variables'][var][1].append(expr_reminder)
 
-
     def visit_relation(self, relation, canon):
         key = '%s%s' % (relation.r_type, relation._not)
         r_list = canon['restriction'].setdefault(key, [])
         self.manage_relation(relation, canon, r_list)
 
-
     def visit_comparison(self, comparison, canon):
         """do nothing for this node type"""
 
--- a/rql/nodes.py	Wed Feb 13 12:31:03 2019 +0100
+++ b/rql/nodes.py	Wed Feb 13 12:31:37 2019 +0100
@@ -894,7 +894,6 @@
         return self.children[0]
 
 
-
 ###############################################################################
 
 class Referenceable(VisitableMixIn):
--- a/rql/parser.py	Wed Feb 13 12:31:03 2019 +0100
+++ b/rql/parser.py	Wed Feb 13 12:31:37 2019 +0100
@@ -694,7 +694,6 @@
 # End -- grammar generated by Yapps
 
 
-
 from warnings import warn
 from rql.stmts import Union, Select, Delete, Insert, Set
 from rql.nodes import *
--- a/rql/rqlgen.py	Wed Feb 13 12:31:03 2019 +0100
+++ b/rql/rqlgen.py	Wed Feb 13 12:31:37 2019 +0100
@@ -72,7 +72,6 @@
             result.append(self.sortby(sorts))
         return '\n'.join(result)
 
-
     def where(self, nupplets):
         """Return a WHERE statement.
 
@@ -108,7 +107,6 @@
                 result.append(',')
         return ' '.join(result)
 
-
     def groupby(self, groups):
         """Return a GROUPBY statement.
 
@@ -122,7 +120,6 @@
         """
         return 'GROUPBY %s' % ', '.join(groups)
 
-
     def sortby(self, sorts):
         """Return a SORTBY statement.
 
@@ -139,7 +136,6 @@
         """
         return 'SORTBY %s' % ', '.join(sorts)
 
-
     def insert(self, etype, attributes):
         """Return an INSERT statement.
 
@@ -157,7 +153,6 @@
                         for attr_name, attr_value in attributes] # .items()]
         return 'INSERT %s X: %s' % (etype, ', '.join(restrictions))
 
-
     def delete(self, etype, attributes):
         """Return a DELETE statement.
 
@@ -175,7 +170,6 @@
                         for attr_name, attr_value in attributes] # .items()]
         return 'DELETE %s X where %s' % (etype, ', '.join(restrictions))
 
-
     def update(self, etype, old_descr, new_descr):
         """Return a SET statement.
 
--- a/rql/stcheck.py	Wed Feb 13 12:31:03 2019 +0100
+++ b/rql/stcheck.py	Wed Feb 13 12:31:37 2019 +0100
@@ -204,7 +204,6 @@
             fromvar = var
         return True
 
-
     def visit_insert(self, insert, state):
         self._visit_selectedterm(insert, state)
     def leave_insert(self, node, state):
--- a/rql/utils.py	Wed Feb 13 12:31:03 2019 +0100
+++ b/rql/utils.py	Wed Feb 13 12:31:37 2019 +0100
@@ -160,7 +160,6 @@
     return u''.join(res)
 
 
-
 class VisitableMixIn(object):
 
     def accept(self, visitor, *args, **kwargs):
--- a/test/unittest_analyze.py	Wed Feb 13 12:31:03 2019 +0100
+++ b/test/unittest_analyze.py	Wed Feb 13 12:31:37 2019 +0100
@@ -58,7 +58,6 @@
             for objtype in dest_types:
                 self.rdefs[(subjtype, objtype)] = mock(subject=subjtype, object=objtype, cardinality=self.card)
 
-
     def associations(self):
         return self.assoc_types
 
@@ -303,7 +302,6 @@
                                      {'X': 'Person', 'T': 'Eetype'},
                                      {'X': 'Student', 'T': 'Eetype'}])
 
-
     def test_not(self):
         node = self.helper.parse('Any X WHERE NOT X is Person')
         self.helper.compute_solutions(node, debug=DEBUG)
@@ -406,7 +404,6 @@
         sols = node.children[0].solutions
         self.assertCountEqual(sols, ALL_SOLS)
 
-
     def test_base_guess_3(self):
         node = self.helper.parse('Any Z GROUPBY Z WHERE X name Z')
         self.helper.compute_solutions(node, debug=DEBUG)
@@ -542,14 +539,12 @@
         self.assertCountEqual(sols, [{'P': 'Person', 'S': 'Company', 'N': 'Int'},
                                      {'P': 'Student', 'S': 'Company', 'N': 'Int'}])
 
-
     def test_nonregr_not_u_ownedby_u(self):
         node = self.helper.parse('Any U WHERE NOT U owned_by U')
         self.helper.compute_solutions(node, debug=DEBUG)
         sols = node.children[0].solutions
         self.assertCountEqual(sols, [{'U': 'Person'}])
 
-
     def test_selection_with_cast(self):
         node = self.helper.parse('Any X WHERE X name CAST(String, E), Y eid E, X owned_by Y')
         self.helper.compute_solutions(node, debug=DEBUG)
@@ -566,6 +561,5 @@
                                      {'X': 'Student', 'Y': 'Company', 'E': 'Int'}])
 
 
-
 if __name__ == '__main__':
     unittest_main()
--- a/test/unittest_editextensions.py	Wed Feb 13 12:31:03 2019 +0100
+++ b/test/unittest_editextensions.py	Wed Feb 13 12:31:37 2019 +0100
@@ -92,7 +92,6 @@
         # check references after recovering
         rqlst.check_references()
 
-
     def test_remove_exists(self):
         rqlst = parse('Any U,COUNT(P) GROUPBY U WHERE U is CWUser, P? patch_reviewer U, EXISTS(P in_state S AND S name "pouet")').children[0]
         orig = rqlst.as_string()
--- a/test/unittest_nodes.py	Wed Feb 13 12:31:03 2019 +0100
+++ b/test/unittest_nodes.py	Wed Feb 13 12:31:37 2019 +0100
@@ -547,7 +547,6 @@
         self.assertEqual(len(tree.children), 2)
         self.assertIsInstance(tree.where, nodes.And)
 
-
     # deletion tests #########################################################
 
     def test_delete_1(self):
@@ -601,7 +600,6 @@
         tree = parse(u"Any X WHERE X creation_date TODAY")
         self.assertEqual(tree.as_string(), 'Any X WHERE X creation_date TODAY')
 
-
     def test_get_type_is_in(self):
         tree = sparse("Any X WHERE X is IN (Person, Company)")
         select = tree.children[0]
--- a/test/unittest_rqlgen.py	Wed Feb 13 12:31:03 2019 +0100
+++ b/test/unittest_rqlgen.py	Wed Feb 13 12:31:37 2019 +0100
@@ -36,28 +36,24 @@
         """
         self.rql_generator = rqlgen.RQLGenerator()
 
-
     def test_select_etype(self):
         """tests select with entity type only
         """
         rql = self.rql_generator.select('Person')
         self.assertEqual(rql, 'Person X')
         
-
     def test_select_group(self):
         """tests select with group
         """
         rql = self.rql_generator.select('Person', groups=('X',))
         self.assertEqual(rql, 'Person X\nGROUPBY X')
 
-
     def test_select_sort(self):
         """tests select with sort
         """
         rql = self.rql_generator.select('Person', sorts=('X ASC',))
         self.assertEqual(rql, 'Person X\nSORTBY X ASC')
 
-
     def test_select(self):
         """tests select with e_type, attributes, sort, and group
         """
@@ -72,7 +68,6 @@
                          ' , X firstname F , X surname S\nGROUPBY X'
                          '\nSORTBY F ASC, S DESC')
                                         
-        
     def test_where(self):
         """tests the where() method behaviour
         """
@@ -83,21 +78,18 @@
         self.assertEqual(rql, 'WHERE X work_for S , S name "Logilab" '
                          ', X firstname F , X surname S')
 
-
     def test_groupby(self):
         """tests the groupby() method behaviour
         """
         rql = self.rql_generator.groupby(('F', 'S'))
         self.assertEqual(rql, 'GROUPBY F, S')
         
-
     def test_sortby(self):
         """tests the sortby() method behaviour
         """
         rql = self.rql_generator.sortby(('F ASC', 'S DESC'))
         self.assertEqual(rql, 'SORTBY F ASC, S DESC')
         
-
     def test_insert(self):
         """tests the insert() method behaviour
         """
@@ -106,7 +98,6 @@
         self.assertEqual(rql, 'INSERT Person X: X firstname "Clark",'
                          ' X lastname "Kent"')
         
-        
     def test_update(self):
         """tests the update() method behaviour
         """
@@ -119,7 +110,6 @@
                          'WHERE X is "Person", X firstname "Clark", X '
                          'lastname "Kent"')
 
-
     def test_delete(self):
         """tests the delete() method behaviour
         """