autopep8: fix E231 missing whitespace after ','
authorPhilippe Pepiot <philippe.pepiot@logilab.fr>
Wed, 13 Feb 2019 17:08:31 +0100
changeset 840 bc3db19a8a53
parent 839 912d08ba315d
child 841 8682fcf6a7f0
autopep8: fix E231 missing whitespace after ','
__pkginfo__.py
rql/analyze.py
rql/parser.py
rql/stmts.py
setup.py
test/unittest_compare.py
test/unittest_nodes.py
test/unittest_rqlgen.py
test/unittest_utils.py
tools/rql_cmp.py
--- a/__pkginfo__.py	Wed Feb 13 17:07:13 2019 +0100
+++ b/__pkginfo__.py	Wed Feb 13 17:08:31 2019 +0100
@@ -53,7 +53,7 @@
 
 
 def gecode_version():
-    version = [3,3,1]
+    version = [3, 3, 1]
     if osp.exists('data/gecode_version.cc'):
         try:
             subprocess.check_call(['g++', '-o', 'gecode_version', 'data/gecode_version.cc'])
@@ -65,7 +65,7 @@
     return version
 
 
-def encode_version(a,b,c):
+def encode_version(a, b, c):
     return ((a<<16)+(b<<8)+c)
 
 
@@ -74,7 +74,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/analyze.py	Wed Feb 13 17:07:13 2019 +0100
+++ b/rql/analyze.py	Wed Feb 13 17:08:31 2019 +0100
@@ -134,10 +134,10 @@
 _EQV = 3
 
 OPSYM={
-    _AND:"and",
-    _OR:"or",
-    _EQ:"eq",
-    _EQV:"eqv"
+    _AND: "and",
+    _OR: "or",
+    _EQ: "eq",
+    _EQV: "eqv"
 }
 
 
@@ -225,7 +225,7 @@
         # maps integer->value
         self.all_values = list(self.all_values)
         # maps value->integer
-        self.values = dict([(v,i) for i,v in enumerate(self.all_values)])
+        self.values = dict([(v, i) for i, v in enumerate(self.all_values)])
         #print(self.values)
         #print(self.domains)
         for var_name in self.ivariables:
--- a/rql/parser.py	Wed Feb 13 17:07:13 2019 +0100
+++ b/rql/parser.py	Wed Feb 13 17:08:31 2019 +0100
@@ -103,8 +103,8 @@
         ('SUBSTITUTE', re.compile('%\\([A-Za-z_0-9]+\\)s')),
     ]
 
-    def __init__(self, str,*args,**kw):
-        runtime.Scanner.__init__(self,None,{'\\s+':None,'/\\*(?:[^*]|\\*(?!/))*\\*/':None,},str,*args,**kw)
+    def __init__(self, str, *args, **kw):
+        runtime.Scanner.__init__(self, None, {'\\s+': None, '/\\*(?:[^*]|\\*(?!/))*\\*/': None, }, str, *args, **kw)
 
 
 class Hercule(runtime.Parser):
--- a/rql/stmts.py	Wed Feb 13 17:07:13 2019 +0100
+++ b/rql/stmts.py	Wed Feb 13 17:08:31 2019 +0100
@@ -272,7 +272,7 @@
           returning a string
         """
         if tr is None:
-            tr = lambda x,**k: x
+            tr = lambda x, **k: x
         return [c.get_description(mainindex, tr) for c in self.children]
 
     # repr / as_string / copy #################################################
--- a/setup.py	Wed Feb 13 17:07:13 2019 +0100
+++ b/setup.py	Wed Feb 13 17:08:31 2019 +0100
@@ -81,6 +81,6 @@
     tests_require=pkginfo.get('tests_require'),
     scripts=pkginfo.get('scripts', []),
     ext_modules=pkginfo.get('ext_modules'),
-    cmdclass={'build_ext':MyBuildExt},
+    cmdclass={'build_ext': MyBuildExt},
     **kwargs
 )
--- a/test/unittest_compare.py	Wed Feb 13 17:07:13 2019 +0100
+++ b/test/unittest_compare.py	Wed Feb 13 17:08:31 2019 +0100
@@ -25,7 +25,7 @@
 
     def __init__(self):
         super(DummySchema, self).__init__()
-        for etype in ['Note',]:
+        for etype in ['Note', ]:
             self._types[etype] = EntitySchema(etype)
         relations = [('a_faire_par', (('Note', ('Person',)),)),
                      ('creation_date', (('Note', ('Date',)),)),
@@ -45,13 +45,13 @@
     def setUp(self):
         self.h = RQLHelper(DummySchema(), None)
 
-    def _compareEquivalent(self,r1,r2):
+    def _compareEquivalent(self, r1, r2):
         """fails if the RQL strings r1 and r2 are equivalent"""
         self.skipTest('broken')
         self.failUnless(self.h.compare(r1, r2),
                         'r1: %s\nr2: %s' % (r1, r2))
 
-    def _compareNotEquivalent(self,r1,r2):
+    def _compareNotEquivalent(self, r1, r2):
         """fails if the RQL strings r1 and r2 are not equivalent"""
         self.failIf(self.h.compare(r1, r2),
                     'r1: %s\nr2: %s' % (r1, r2))
@@ -141,7 +141,7 @@
     def test_diff_request(self):
         r1 = "Any N, N2 WHERE N is Note, N2 is Note, N a_faire_par P1, P1 nom 'jphc', N2 a_faire_par P2, P2 nom 'ocy' ;"
         r2 = "Any X WHERE X is Note ;"
-        self._compareNotEquivalent(r1,r2)
+        self._compareNotEquivalent(r1, r2)
 
     def test_diff_request_and_or(self):
         r1 = "Note N WHERE N creation_date > today-10, N a_faire_par P, P nom 'jphc' or P nom 'ludal';"
--- a/test/unittest_nodes.py	Wed Feb 13 17:07:13 2019 +0100
+++ b/test/unittest_nodes.py	Wed Feb 13 17:08:31 2019 +0100
@@ -626,8 +626,8 @@
         self.assertEqual(X.get_type(), 'Company')
         self.assertEqual(X.get_type({'X': 'Person'}), 'Person')
         #self.assertEqual(N.get_type(), 'String')
-        self.assertEqual(X.get_description(0, lambda x,**k:x), 'Company, Person, Student')
-        self.assertEqual(N.get_description(0, lambda x,**k:x), 'firstname, name')
+        self.assertEqual(X.get_description(0, lambda x, **k: x), 'Company, Person, Student')
+        self.assertEqual(N.get_description(0, lambda x, **k: x), 'firstname, name')
         self.assertEqual(X.selected_index(), 0)
         self.assertEqual(N.selected_index(), None)
         self.assertEqual(X.main_relation(), None)
--- a/test/unittest_rqlgen.py	Wed Feb 13 17:07:13 2019 +0100
+++ b/test/unittest_rqlgen.py	Wed Feb 13 17:08:31 2019 +0100
@@ -58,10 +58,10 @@
         """tests select with e_type, attributes, sort, and group
         """
         rql = self.rql_generator.select('Person',
-                                        (('X','work_for','S'),
-                                          ('S','name','"Logilab"'),
-                                          ('X','firstname','F'),
-                                          ('X','surname','S')),
+                                        (('X', 'work_for', 'S'),
+                                          ('S', 'name', '"Logilab"'),
+                                          ('X', 'firstname', 'F'),
+                                          ('X', 'surname', 'S')),
                                         ('X',),
                                         ('F ASC', 'S DESC'))
         self.assertEqual(rql, 'Person X\nWHERE X work_for S , S name "Logilab"'
@@ -71,10 +71,10 @@
     def test_where(self):
         """tests the where() method behaviour
         """
-        rql = self.rql_generator.where((('X','work_for','S'),
-                                         ('S','name','"Logilab"'),
-                                         ('X','firstname','F'),
-                                         ('X','surname','S')))
+        rql = self.rql_generator.where((('X', 'work_for', 'S'),
+                                         ('S', 'name', '"Logilab"'),
+                                         ('X', 'firstname', 'F'),
+                                         ('X', 'surname', 'S')))
         self.assertEqual(rql, 'WHERE X work_for S , S name "Logilab" '
                          ', X firstname F , X surname S')
 
--- a/test/unittest_utils.py	Wed Feb 13 17:07:13 2019 +0100
+++ b/test/unittest_utils.py	Wed Feb 13 17:08:31 2019 +0100
@@ -46,7 +46,7 @@
         self.visitor.visit(tree)
 
     def test_methods_3(self):
-        tree = parse('Set X nom "yo" WHERE X is Person', {'Person':nodes.Constant('Person', 'etype')})
+        tree = parse('Set X nom "yo" WHERE X is Person', {'Person': nodes.Constant('Person', 'etype')})
         self.visitor.visit(tree)
 
     def test_methods_4(self):
--- a/tools/rql_cmp.py	Wed Feb 13 17:07:13 2019 +0100
+++ b/tools/rql_cmp.py	Wed Feb 13 17:08:31 2019 +0100
@@ -52,9 +52,9 @@
     d1 = make_canon_dict(x1)
     d2 = make_canon_dict(x2)
     t = d1==d2
-    print('%s : "%s"' % (t,l))
+    print('%s : "%s"' % (t, l))
     if not t:
-        print("CPP",x1)
+        print("CPP", x1)
         pprint(d1)
-        print("PYT",x2)
+        print("PYT", x2)
         pprint(d2)