autopep8: E265 block comment should start with '# '
authorSimon Chabot <simon.chabot@logilab.fr>
Wed, 13 Feb 2019 18:28:29 +0100
changeset 855 c313ddea4a3e
parent 854 fe2a97f8a99e
child 856 269164a1371a
autopep8: E265 block comment should start with '# '
__pkginfo__.py
doc/conf.py
rql/__init__.py
rql/analyze.py
rql/stcheck.py
rql/stmts.py
test/unittest_nodes.py
tools/bench_cpprql.py
tools/rql_analyze.py
tools/rql_cmp.py
tox.ini
--- a/__pkginfo__.py	Wed Feb 13 18:25:45 2019 +0100
+++ b/__pkginfo__.py	Wed Feb 13 18:28:29 2019 +0100
@@ -87,7 +87,7 @@
                                         'GecodeSupport-3-3-1-r-x86',
                                         ],
                              extra_compile_args=['/DGE_VERSION=%s' % GECODE_VERSION, '/EHsc'],
-                             #extra_link_args=['-static-libgcc'],
+                             # extra_link_args=['-static-libgcc'],
                              )
                    ]
 
--- a/doc/conf.py	Wed Feb 13 18:25:45 2019 +0100
+++ b/doc/conf.py	Wed Feb 13 18:28:29 2019 +0100
@@ -34,7 +34,7 @@
 # If your extensions are in another directory, add it here. If the directory
 # is relative to the documentation root, use os.path.abspath to make it
 # absolute, like shown here.
-#sys.path.append(os.path.abspath('some/directory'))
+# sys.path.append(os.path.abspath('some/directory'))
 
 # General configuration
 # ---------------------
@@ -66,30 +66,30 @@
 
 # There are two options for replacing |today|: either, you set today to some
 # non-false value, then it is used:
-#today = ''
+# today = ''
 # Else, today_fmt is used as the format for a strftime call.
 today_fmt = '%B %d, %Y'
 
 # List of documents that shouldn't be included in the build.
-#unused_docs = []
+# unused_docs = []
 
 # List of directories, relative to source directories, that shouldn't be searched
 # for source files.
-#exclude_dirs = []
+# exclude_dirs = []
 
 # The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
+# default_role = None
 
 # If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
+# add_function_parentheses = True
 
 # If true, the current module name will be prepended to all description
 # unit titles (such as .. function::).
-#add_module_names = True
+# add_module_names = True
 
 # If true, sectionauthor and moduleauthor directives will be shown in the
 # output. They are ignored by default.
-#show_authors = False
+# show_authors = False
 
 # The name of the Pygments (syntax highlighting) style to use.
 pygments_style = 'sphinx'
@@ -105,19 +105,19 @@
 
 # The name for this set of Sphinx documents.  If None, it defaults to
 # "<project> v<release> documentation".
-#html_title = None
+# html_title = None
 
 # A shorter title for the navigation bar.  Default is the same as html_title.
-#html_short_title = None
+# html_short_title = None
 
 # The name of an image file (within the static path) to place at the top of
 # the sidebar.
-#html_logo = None
+# html_logo = None
 
 # The name of an image file (within the static path) to use as favicon of the
 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
 # pixels large.
-#html_favicon = None
+# html_favicon = None
 
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
@@ -130,34 +130,34 @@
 
 # If true, SmartyPants will be used to convert quotes and dashes to
 # typographically correct entities.
-#html_use_smartypants = True
+# html_use_smartypants = True
 
 # Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
+# html_sidebars = {}
 
 # Additional templates that should be rendered to pages, maps page names to
 # template names.
-#html_additional_pages = {}
+# html_additional_pages = {}
 
 # If false, no module index is generated.
-#html_use_modindex = True
+# html_use_modindex = True
 
 # If false, no index is generated.
-#html_use_index = True
+# html_use_index = True
 
 # If true, the index is split into individual pages for each letter.
-#html_split_index = False
+# html_split_index = False
 
 # If true, the reST sources are included in the HTML build as _sources/<name>.
-#html_copy_source = True
+# html_copy_source = True
 
 # If true, an OpenSearch description file will be output, and all pages will
 # contain a <link> tag referring to it.  The value of this option must be the
 # base URL from which the finished HTML is served.
-#html_use_opensearch = ''
+# html_use_opensearch = ''
 
 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = ''
+# html_file_suffix = ''
 
 # Output file base name for HTML help builder.
 htmlhelp_basename = 'RQLdoc'
@@ -167,10 +167,10 @@
 # ------------------------
 
 # The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
+# latex_paper_size = 'letter'
 
 # The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
+# latex_font_size = '10pt'
 
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, document class [howto/manual]).
@@ -181,17 +181,17 @@
 
 # The name of an image file (relative to this directory) to place at the top of
 # the title page.
-#latex_logo = None
+# latex_logo = None
 
 # For "manual" documents, if this is true, then toplevel headings are parts,
 # not chapters.
-#latex_use_parts = False
+# latex_use_parts = False
 
 # Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
+# latex_preamble = ''
 
 # Documents to append as an appendix to all manuals.
-#latex_appendices = []
+# latex_appendices = []
 
 # If false, no module index is generated.
-#latex_use_modindex = True
+# latex_use_modindex = True
--- a/rql/__init__.py	Wed Feb 13 18:25:45 2019 +0100
+++ b/rql/__init__.py	Wed Feb 13 18:28:29 2019 +0100
@@ -30,7 +30,7 @@
 
 
 __version__ = pkg_resources.get_distribution('rql').version
-#REQUIRED_TYPES = ['String', 'Float', 'Int', 'Boolean', 'Date']
+# REQUIRED_TYPES = ['String', 'Float', 'Int', 'Boolean', 'Date']
 
 
 class RQLHelper(object):
@@ -45,7 +45,7 @@
     def __init__(self, schema, uid_func_mapping=None, special_relations=None,
                  resolver_class=None, backend=None):
         # chech schema
-        #for e_type in REQUIRED_TYPES:
+        # for e_type in REQUIRED_TYPES:
         #    if not schema.has_entity(e_type):
         #        raise MissingType(e_type)
         # create helpers
@@ -126,7 +126,7 @@
 
         The tree is modified in-place.
         """
-        #print('simplify', rqlst.as_string())
+        # print('simplify', rqlst.as_string())
         if rqlst.TYPE == 'select':
             from rql import nodes
             for select in rqlst.children:
--- a/rql/analyze.py	Wed Feb 13 18:25:45 2019 +0100
+++ b/rql/analyze.py	Wed Feb 13 18:28:29 2019 +0100
@@ -42,7 +42,7 @@
     from logilab.constraint import Repository, Solver, fd
 
     # Gecode solver not available
-#rql_solve = None # uncomment to force using logilab-constraint
+# rql_solve = None # uncomment to force using logilab-constraint
 
 
 class ConstraintCSPProblem(object):
@@ -68,10 +68,10 @@
         repo = Repository(self.domains.keys(), self.domains, self.get_constraints())
         solver = Solver(printer=self.printer)
         # used for timing
-        #import time
-        #t0=time.time()
+        # import time
+        # t0=time.time()
         sols = solver.solve(repo, verbose=(True or self.debug))
-        #print("RUNTIME:", time.time()-t0)
+        # print("RUNTIME:", time.time()-t0)
         return sols
 
     def add_var(self, name, values):
@@ -201,8 +201,8 @@
         constraints = self.op
 
         # used for timing
-        #import time
-        #t0=time.time()
+        # import time
+        # t0=time.time()
 
         sols = rql_solve.solve(self.idx_domains, len(self.all_values), constraints)
         rql_sols = []
@@ -211,7 +211,7 @@
             for var, val in zip(self.ivariables, s):
                 r[var] = self.all_values[val]
             rql_sols.append(r)
-        #print("RUNTIME:", time.time()-t0)
+        # print("RUNTIME:", time.time()-t0)
         return rql_sols
 
     def add_var(self, name, values):
@@ -226,8 +226,8 @@
         self.all_values = list(self.all_values)
         # maps value->integer
         self.values = dict([(v, i) for i, v in enumerate(self.all_values)])
-        #print(self.values)
-        #print(self.domains)
+        # print(self.values)
+        # print(self.domains)
         for var_name in self.ivariables:
             val_domain = self.domains[var_name]
             idx_domain = [self.values[val] for val in val_domain]
@@ -289,7 +289,7 @@
 else:
     CSPProblem = GecodeCSPProblem
 
-#CSPProblem = ConstraintCSPProblem
+# CSPProblem = ConstraintCSPProblem
 
 
 class ETypeResolver(object):
--- a/rql/stcheck.py	Wed Feb 13 18:25:45 2019 +0100
+++ b/rql/stcheck.py	Wed Feb 13 18:28:29 2019 +0100
@@ -94,7 +94,7 @@
         self._visit(node, state)
         if state.errors:
             raise BadRQLQuery('%s\n** %s' % (node, '\n** '.join(state.errors)))
-        #if node.TYPE == 'select' and \
+        # if node.TYPE == 'select' and \
         #       not node.defined_vars and not node.get_restriction():
         #    result = []
         #    for term in node.selected_terms():
@@ -294,7 +294,7 @@
         pass
 
     def visit_or(self, ou, state):
-        #assert len(ou.children) == 2, len(ou.children)
+        # assert len(ou.children) == 2, len(ou.children)
         # simplify Ored expression of a symmetric relation
         r1, r2 = ou.children[0], ou.children[1]
         try:
@@ -407,7 +407,7 @@
 
     def leave_relation(self, relation, state):
         pass
-        #assert isinstance(lhs, VariableRef), '%s: %s' % (lhs.__class__,
+        # assert isinstance(lhs, VariableRef), '%s: %s' % (lhs.__class__,
         #                                                       relation)
 
     def visit_comparison(self, comparison, state):
@@ -448,19 +448,19 @@
                        function.children[0].descr().aggregat:
                     state.error('can\'t nest aggregat functions')
             if funcdescr.name == 'IN':
-                #assert function.parent.operator == '='
+                # assert function.parent.operator == '='
                 if len(function.children) == 1:
                     function.parent.append(function.children[0])
                     function.parent.remove(function)
-                #else:
+                # else:
                 #    assert len(function.children) >= 1
 
     def leave_function(self, node, state):
         pass
 
     def visit_variableref(self, variableref, state):
-        #assert len(variableref.children)==0
-        #assert not variableref.parent is variableref
+        # assert len(variableref.children)==0
+        # assert not variableref.parent is variableref
         pass
 
     def leave_variableref(self, node, state):
@@ -496,7 +496,7 @@
         self.special_relations = special_relations or {}
 
     def annotate(self, node):
-        #assert not node.annotated
+        # assert not node.annotated
         node.accept(self)
         node.annotated = True
 
@@ -646,7 +646,7 @@
     visit_or = visit_and
 
     def visit_relation(self, relation, scope):
-        #assert relation.parent, repr(relation)
+        # assert relation.parent, repr(relation)
         lhs, rhs = relation.get_parts()
         # may be a constant once rqlst has been simplified
         lhsvar = getattr(lhs, 'variable', None)
--- a/rql/stmts.py	Wed Feb 13 18:25:45 2019 +0100
+++ b/rql/stmts.py	Wed Feb 13 18:28:29 2019 +0100
@@ -149,7 +149,7 @@
             for solution in solutions:
                 var.stinfo[key].add(solution[var.name])
         # for debugging
-        #for sol in solutions:
+        # for sol in solutions:
         #    for vname in sol:
         #        assert vname in self.defined_vars or vname in self.aliases
 
@@ -789,7 +789,7 @@
 
     def remove_selected(self, var):
         """deletes var from selection variable"""
-        #assert isinstance(var, VariableRef)
+        # assert isinstance(var, VariableRef)
         index = self._var_index(var)
         if self.should_register_op:
             from rql.undo import UnselectVarOperation
@@ -924,7 +924,7 @@
 
     def add_main_variable(self, etype, vref):
         """add a variable to the list of deleted variables"""
-        #if etype == 'Any':
+        # if etype == 'Any':
         #    raise BadRQLQuery('"Any" is not supported in DELETE statement')
         vref.parent = self
         self.main_variables.append((etype, vref))
--- a/test/unittest_nodes.py	Wed Feb 13 18:25:45 2019 +0100
+++ b/test/unittest_nodes.py	Wed Feb 13 18:28:29 2019 +0100
@@ -143,14 +143,14 @@
         return self._parse(rql).children[0]
 
     def check_equal_but_not_same(self, tree1, tree2):
-        #d1 = tree1.__dict__.copy()
-        #del d1['parent']; del d1['children'] # parent and children are slots now
-        #d2 = tree2.__dict__.copy()
-        #del d2['parent']; del d2['children']
+        # d1 = tree1.__dict__.copy()
+        # del d1['parent']; del d1['children'] # parent and children are slots now
+        # d2 = tree2.__dict__.copy()
+        # del d2['parent']; del d2['children']
         self.assertNotEqual(id(tree1), id(tree2))
         self.assertTrue(tree1.is_equivalent(tree2))
-        #self.assertEqual(len(tree1.children), len(tree2.children))
-        #for i in range(len(tree1.children)):
+        # self.assertEqual(len(tree1.children), len(tree2.children))
+        # for i in range(len(tree1.children)):
         #    self.check_equal_but_not_same(tree1.children[i], tree2.children[i])
 
     # selection tests #########################################################
@@ -621,11 +621,11 @@
         self.assertEqual(len(X.references()), 3)
         self.assertEqual(len(N.references()), 2)
         tree.schema = schema
-        #annotator.annotate(tree)
+        # annotator.annotate(tree)
         # XXX how to choose
         self.assertEqual(X.get_type(), 'Company')
         self.assertEqual(X.get_type({'X': 'Person'}), 'Person')
-        #self.assertEqual(N.get_type(), 'String')
+        # 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.selected_index(), 0)
--- a/tools/bench_cpprql.py	Wed Feb 13 18:25:45 2019 +0100
+++ b/tools/bench_cpprql.py	Wed Feb 13 18:28:29 2019 +0100
@@ -47,6 +47,6 @@
 
 f = open(sys.argv[1])
 for l in f:
-    #print(l, end="")
+    # print(l, end="")
     x = parse(l, builder)
     print(".", end="")
--- a/tools/rql_analyze.py	Wed Feb 13 18:25:45 2019 +0100
+++ b/tools/rql_analyze.py	Wed Feb 13 18:28:29 2019 +0100
@@ -29,7 +29,7 @@
 
 schema = load_schema(SCHEMA_DIRECTORY, APP_NAME)
 
-#print(schema)
+# print(schema)
 
 
 def cmp_sol(sol1, sol2):
--- a/tools/rql_cmp.py	Wed Feb 13 18:25:45 2019 +0100
+++ b/tools/rql_cmp.py	Wed Feb 13 18:28:29 2019 +0100
@@ -45,7 +45,7 @@
 
 f = file(sys.argv[1])
 for l in f:
-    #print(l, end="")
+    # print(l, end="")
     x1 = cparse(l, builder)
     x2 = parse(l)
     l = l.strip()
--- a/tox.ini	Wed Feb 13 18:25:45 2019 +0100
+++ b/tox.ini	Wed Feb 13 18:28:29 2019 +0100
@@ -11,7 +11,7 @@
 basepython = python3
 deps =
   flake8
-commands = flake8 {posargs:--ignore=E261,E265,E402,E501,E731,E741,F401,F401,F403,F405,F811,F821,F841,E123,E226,W503,E241,W504,E126,E121}
+commands = flake8 {posargs:--ignore=E402,E501,E731,E741,F401,F401,F403,F405,F811,F821,F841,E123,E226,W503,E241,W504,E126,E121}
 
 [pytest]
 python_files = *test_*.py