autopep8: fix E203 whitespace before ':'
authorSimon Chabot <simon.chabot@logilab.fr>
Wed, 13 Feb 2019 18:14:10 +0100
changeset 852 0fb66fc1a945
parent 851 ddf078af91d8
child 853 739621276982
autopep8: fix E203 whitespace before ':'
rql/__init__.py
rql/base.py
rql/compare.py
rql/nodes.py
rql/rqlgen.py
test/unittest_analyze.py
tools/bench_cpprql.py
tools/rql_cmp.py
tools/rql_parse.py
tox.ini
--- a/rql/__init__.py	Wed Feb 13 17:30:46 2019 +0100
+++ b/rql/__init__.py	Wed Feb 13 18:14:10 2019 +0100
@@ -207,7 +207,7 @@
     from rql.parser import Hercule, HerculeScanner
     # make sure rql string ends with a semi-colon
     rqlstring = rqlstring.strip()
-    if rqlstring and not rqlstring.endswith(';') :
+    if rqlstring and not rqlstring.endswith(';'):
         rqlstring += ';'
     # parse the RQL string
     parser = Hercule(HerculeScanner(rqlstring))
--- a/rql/base.py	Wed Feb 13 17:30:46 2019 +0100
+++ b/rql/base.py	Wed Feb 13 18:14:10 2019 +0100
@@ -137,7 +137,7 @@
     """Class for nodes of the tree which may have children (almost all...)"""
     __slots__ = ('children',)
 
-    def __init__(self) :
+    def __init__(self):
         self.parent = None
         self.children = []
 
--- a/rql/compare.py	Wed Feb 13 17:30:46 2019 +0100
+++ b/rql/compare.py	Wed Feb 13 18:14:10 2019 +0100
@@ -41,9 +41,9 @@
     """Return a canonical representation of the request as a dictionnary."""
     allvars = {}
     canon = {
-        'all_variables' : allvars,
-        'selected' : [],
-        'restriction' : {},
+        'all_variables': allvars,
+        'selected': [],
+        'restriction': {},
         }
 
     canon = RQLCanonizer().visit(rql_tree, canon)
--- a/rql/nodes.py	Wed Feb 13 17:30:46 2019 +0100
+++ b/rql/nodes.py	Wed Feb 13 18:14:10 2019 +0100
@@ -54,7 +54,7 @@
     ETYPE_PYOBJ_MAP[long] = 'Int'
     ETYPE_PYOBJ_MAP[unicode] = 'String'
 
-KEYWORD_MAP = {'NOW' : datetime.now,
+KEYWORD_MAP = {'NOW': datetime.now,
                'TODAY': date.today}
 
 
--- a/rql/rqlgen.py	Wed Feb 13 17:30:46 2019 +0100
+++ b/rql/rqlgen.py	Wed Feb 13 18:14:10 2019 +0100
@@ -30,7 +30,7 @@
     Helper class to generate RQL strings.
     """
 
-    def select(self, etype, nupplets=(), groups=(), sorts=()) :
+    def select(self, etype, nupplets=(), groups=(), sorts=()):
         """
         Return a RQL selection query.
 
--- a/test/unittest_analyze.py	Wed Feb 13 17:30:46 2019 +0100
+++ b/test/unittest_analyze.py	Wed Feb 13 18:14:10 2019 +0100
@@ -92,76 +92,76 @@
             self._types[etype] = EntitySchema(etype)
         self._types['Person']._specialized_by = [self._types['Student']]
         self._relations = {
-            'eid' : RelationSchema((('Person', ('Int',)),
+            'eid': RelationSchema((('Person', ('Int',)),
                                       ('Student', ('Int',)),
                                       ('Company', ('Int',)),
                                       ('Address', ('Int',)),
                                       ('Eetype', ('Int',)),
-                                    )
-                                   ),
-            'creation_date' : RelationSchema((('Person', ('Datetime',)),
+                                   )
+                                  ),
+            'creation_date': RelationSchema((('Person', ('Datetime',)),
                                                 ('Student', ('Datetime',)),
                                                 ('Company', ('Datetime',)),
                                                 ('Address', ('Datetime',)),
                                                 ('Eetype', ('Datetime',)),
-                                              )
-                                             ),
-            'name' : RelationSchema((('Person', ('String',)),
+                                             )
+                                            ),
+            'name': RelationSchema((('Person', ('String',)),
                                        ('Student', ('String',)),
                                        ('Company', ('String',)),
-                                     )
-                                    ),
-            'firstname' : RelationSchema((('Person', ('String',)),
+                                    )
+                                   ),
+            'firstname': RelationSchema((('Person', ('String',)),
                                             ('Student', ('String',)),
-                                          )
-                                         ),
-            'work_for' : RelationSchema((('Person', ('Company',)),
+                                         )
+                                        ),
+            'work_for': RelationSchema((('Person', ('Company',)),
                                            ('Student', ('Company',)),
-                                         ),
+                                        ),
                                          card='?*'),
-            'is' : RelationSchema((('Person', ('Eetype',)),
+            'is': RelationSchema((('Person', ('Eetype',)),
                                      ('Student', ('Eetype',)),
                                      ('Company', ('Eetype',)),
                                      ('Address', ('Eetype',)),
                                      ('Eetype', ('Eetype',)),
-                                   )
-                                  ),
-            'is_instance_of' : RelationSchema((('Person', ('Eetype',)),
+                                  )
+                                 ),
+            'is_instance_of': RelationSchema((('Person', ('Eetype',)),
                                                ('Student', ('Eetype',)),
                                                ('Company', ('Eetype',)),
                                                ('Address', ('Eetype',)),
                                                ('Eetype', ('Eetype',)),
-                                               )
-                                              ),
-            'connait' : RelationSchema((('Person', ('Person',)),
+                                              )
+                                             ),
+            'connait': RelationSchema((('Person', ('Person',)),
                                          ('Student', ('Person',)),
                                          ('Student', ('Student',)),
                                          ('Person', ('Student',)),
-                                        ),
+                                       ),
                                         symmetric=True),
-            'located' : RelationSchema((('Person', ('Address',)),
+            'located': RelationSchema((('Person', ('Address',)),
                                           ('Student', ('Address',)),
                                           ('Company', ('Address',)),
-                                        )
-                                       ),
-            'owned_by' : RelationSchema((('Person', ('Person',)),
+                                       )
+                                      ),
+            'owned_by': RelationSchema((('Person', ('Person',)),
                                            ('Student', ('Person',)),
                                            ('Company', ('Person',)),
                                            ('Eetype', ('Person',)),
-                                         )
-                                        ),
-            'identity' : RelationSchema((('Person', ('Person',)),
+                                        )
+                                       ),
+            'identity': RelationSchema((('Person', ('Person',)),
                                            ('Student', ('Student',)),
                                            ('Company', ('Company',)),
                                            ('Address', ('Address',)),
                                            ('Eetype', ('Eetype',)),
-                                         )
-                                        ),
-            'number' : RelationSchema((('Person', ('Int',)),
+                                        )
+                                       ),
+            'number': RelationSchema((('Person', ('Int',)),
                                          ('Student', ('Int',)),
                                          ('Company', ('Float',)),
-                                       )
-                                      ),
+                                      )
+                                     ),
             }
         for rtype, rschema in self._relations.items():
             rschema.type = rtype
--- a/tools/bench_cpprql.py	Wed Feb 13 17:30:46 2019 +0100
+++ b/tools/bench_cpprql.py	Wed Feb 13 18:14:10 2019 +0100
@@ -24,20 +24,20 @@
 from rql.stmts import *
 
 builder = {
-    "Constant" : Constant,
-    "Function" : Function,
-    "Relation" : Relation,
-    "Comparison" : Comparison,
-    "And" : AND,
-    "Or" : OR,
-    "VariableRef" : VariableRef,
-    "Insert" : Insert,
-    "Select" : Select,
-    "Delete" : Delete,
-    "Update" : Update,
-    "MathExpression" : MathExpression,
-    "Sort" : Sort,
-    "Sortterm" : SortTerm,
+    "Constant": Constant,
+    "Function": Function,
+    "Relation": Relation,
+    "Comparison": Comparison,
+    "And": AND,
+    "Or": OR,
+    "VariableRef": VariableRef,
+    "Insert": Insert,
+    "Select": Select,
+    "Delete": Delete,
+    "Update": Update,
+    "MathExpression": MathExpression,
+    "Sort": Sort,
+    "Sortterm": SortTerm,
 }
 
 if len(sys.argv) < 2:
--- a/tools/rql_cmp.py	Wed Feb 13 17:30:46 2019 +0100
+++ b/tools/rql_cmp.py	Wed Feb 13 18:14:10 2019 +0100
@@ -26,20 +26,20 @@
 from pprint import pprint
 
 builder = {
-    "Constant" : Constant,
-    "Function" : Function,
-    "Relation" : Relation,
-    "Comparison" : Comparison,
-    "And" : AND,
-    "Or" : OR,
-    "VariableRef" : VariableRef,
-    "Insert" : Insert,
-    "Select" : Select,
-    "Delete" : Delete,
-    "Update" : Update,
-    "MathExpression" : MathExpression,
-    "Sort" : Sort,
-    "Sortterm" : SortTerm,
+    "Constant": Constant,
+    "Function": Function,
+    "Relation": Relation,
+    "Comparison": Comparison,
+    "And": AND,
+    "Or": OR,
+    "VariableRef": VariableRef,
+    "Insert": Insert,
+    "Select": Select,
+    "Delete": Delete,
+    "Update": Update,
+    "MathExpression": MathExpression,
+    "Sort": Sort,
+    "Sortterm": SortTerm,
 }
 
 
--- a/tools/rql_parse.py	Wed Feb 13 17:30:46 2019 +0100
+++ b/tools/rql_parse.py	Wed Feb 13 18:14:10 2019 +0100
@@ -22,20 +22,20 @@
 from rql.stmts import *
 
 builder = {
-    "Constant" : Constant,
-    "Function" : Function,
-    "Relation" : Relation,
-    "Comparison" : Comparison,
-    "And" : AND,
-    "Or" : OR,
-    "VariableRef" : VariableRef,
-    "Insert" : Insert,
-    "Select" : Select,
-    "Delete" : Delete,
-    "Update" : Update,
-    "MathExpression" : MathExpression,
-    "Sort" : Sort,
-    "SortTerm" : SortTerm,
+    "Constant": Constant,
+    "Function": Function,
+    "Relation": Relation,
+    "Comparison": Comparison,
+    "And": AND,
+    "Or": OR,
+    "VariableRef": VariableRef,
+    "Insert": Insert,
+    "Select": Select,
+    "Delete": Delete,
+    "Update": Update,
+    "MathExpression": MathExpression,
+    "Sort": Sort,
+    "SortTerm": SortTerm,
 }
 
 
--- a/tox.ini	Wed Feb 13 17:30:46 2019 +0100
+++ b/tox.ini	Wed Feb 13 18:14:10 2019 +0100
@@ -11,7 +11,7 @@
 basepython = python3
 deps =
   flake8
-commands = flake8 {posargs:--ignore=E127,E203,E261,E265,E402,E501,E731,E741,F401,F401,F403,F405,F811,F821,F841,E123,E226,W503,E241,W504,E126,E121}
+commands = flake8 {posargs:--ignore=E127,E261,E265,E402,E501,E731,E741,F401,F401,F403,F405,F811,F821,F841,E123,E226,W503,E241,W504,E126,E121}
 
 [pytest]
 python_files = *test_*.py