autopep8: fix E225 missing whitespace around operator
authorPhilippe Pepiot <philippe.pepiot@logilab.fr>
Wed, 13 Feb 2019 17:11:54 +0100
changeset 842 48d8347641b8
parent 841 8682fcf6a7f0
child 843 8cd02e8372be
autopep8: fix E225 missing whitespace around operator
rql/analyze.py
rql/stmts.py
tools/bench_cpprql.py
tools/rql_analyze.py
tools/rql_cmp.py
--- a/rql/analyze.py	Wed Feb 13 17:11:31 2019 +0100
+++ b/rql/analyze.py	Wed Feb 13 17:11:54 2019 +0100
@@ -113,10 +113,10 @@
         for orred_expr in equalities:
             anded = set()
             for vars, types in orred_expr:
-                types=tuple(types)
+                types = tuple(types)
                 for t in types:
                     assert isinstance(t, string_types)
-                if len(types)==1:
+                if len(types) == 1:
                     anded.add('%s == "%s"' % ('=='.join(vars), types[0]))
                 else:
                     anded.add('%s in %s' % ('=='.join(vars), types))
@@ -133,7 +133,7 @@
 _EQ = 2
 _EQV = 3
 
-OPSYM={
+OPSYM = {
     _AND: "and",
     _OR: "or",
     _EQ: "eq",
@@ -207,7 +207,7 @@
         sols = rql_solve.solve(self.idx_domains, len(self.all_values), constraints)
         rql_sols = []
         for s in sols:
-            r={}
+            r = {}
             for var, val in zip(self.ivariables, s):
                 r[var] = self.all_values[val]
             rql_sols.append(r)
@@ -237,7 +237,7 @@
         self.op.append([_EQ, self.variables[var], self.values[value]])
 
     def equal_vars(self, varnames):
-        if len(varnames)>1:
+        if len(varnames) > 1:
             self.op.append([_EQV] + [self.variables[v] for v in varnames])
 
     def var_has_type(self, var, etype):
@@ -273,7 +273,7 @@
                 for t in types:
                     assert isinstance(t, string_types)
                 for var in vars:
-                    if len(types)==1:
+                    if len(types) == 1:
                         anded.append([_EQ, self.variables[var], self.values[types[0]]])
                     else:
                         or2 = [_OR]
--- a/rql/stmts.py	Wed Feb 13 17:11:31 2019 +0100
+++ b/rql/stmts.py	Wed Feb 13 17:11:54 2019 +0100
@@ -942,7 +942,7 @@
     def __repr__(self):
         result = ['DELETE']
         if self.main_variables:
-            result.append(', '.join(['%r %r' %(etype, var)
+            result.append(', '.join(['%r %r' % (etype, var)
                                      for etype, var in self.main_variables]))
         if self.main_relations:
             if self.main_variables:
@@ -958,7 +958,7 @@
         """return the tree as an encoded rql string"""
         result = ['DELETE']
         if self.main_variables:
-            result.append(', '.join(['%s %s' %(etype, var)
+            result.append(', '.join(['%s %s' % (etype, var)
                                      for etype, var in self.main_variables]))
         if self.main_relations:
             if self.main_variables:
--- a/tools/bench_cpprql.py	Wed Feb 13 17:11:31 2019 +0100
+++ b/tools/bench_cpprql.py	Wed Feb 13 17:11:54 2019 +0100
@@ -40,7 +40,7 @@
     "Sortterm" : SortTerm,
 }
 
-if len(sys.argv)<2:
+if len(sys.argv) < 2:
     print("Usage: bench_cpprql file")
     print("     file: a file containing rql queries")
     sys.exit(1)
--- a/tools/rql_analyze.py	Wed Feb 13 17:11:31 2019 +0100
+++ b/tools/rql_analyze.py	Wed Feb 13 17:11:54 2019 +0100
@@ -56,7 +56,7 @@
     return helper1, helper2, node1, node2, sol1, sol2
 
 
-if len(sys.argv)<2:
+if len(sys.argv) < 2:
     print("Usage: rql_analyze.py file")
     sys.exit(1)
 
--- a/tools/rql_cmp.py	Wed Feb 13 17:11:31 2019 +0100
+++ b/tools/rql_cmp.py	Wed Feb 13 17:11:54 2019 +0100
@@ -51,7 +51,7 @@
     l = l.strip()
     d1 = make_canon_dict(x1)
     d2 = make_canon_dict(x2)
-    t = d1==d2
+    t = d1 == d2
     print('%s : "%s"' % (t, l))
     if not t:
         print("CPP", x1)