[pep8] fix F841, E501, F821, E266, E713
authorNoe Gaumont <ngaumont@logilab.fr>
Fri, 12 Apr 2019 10:24:25 +0200
changeset 206 5df0a685cc1a
parent 205 3e977506f634
child 207 b934579f848e
[pep8] fix F841, E501, F821, E266, E713
cubicweb_keyword/hooks.py
cubicweb_keyword/views.py
--- a/cubicweb_keyword/hooks.py	Fri Apr 12 10:13:00 2019 +0200
+++ b/cubicweb_keyword/hooks.py	Fri Apr 12 10:24:25 2019 +0200
@@ -75,11 +75,12 @@
                              'P eid %(p)s', {'p': parent.eid, 'k': self.eidfrom})
 
 
-## operations #################################################################
+# operations #################################################################
 class SetIncludedInRelationOp(Operation):
     """delay this operation to commit to avoid conflict with a late rql query
     already setting the relation
     """
+
     def precommit_event(self):
         cnx = self.cnx
         # test for indirect cycles
@@ -119,5 +120,5 @@
                     closure.add((child, parent))
         for child, parent in closure:
             descendants = [p.eid for p in child.descendant_of]
-            if not parent.eid in descendants:
+            if parent.eid not in descendants:
                 child.cw_set(descendant_of=parent)
--- a/cubicweb_keyword/views.py	Fri Apr 12 10:13:00 2019 +0200
+++ b/cubicweb_keyword/views.py	Fri Apr 12 10:24:25 2019 +0200
@@ -16,7 +16,7 @@
 from cubicweb.web.views.ajaxcontroller import ajaxfunc
 
 from cubicweb.web.views import uicfg
-
+from six.moves import xrange
 
 _pvs = uicfg.primaryview_section
 _pvs.tag_object_of(('*', 'applied_to', '*'), 'hidden')
@@ -219,7 +219,7 @@
             keyword_var = rqlst.make_variable()  # K
             keyword_name_var = rqlst.make_variable()  # KN
             classif_var = rqlst.make_variable()  # C
-            classif_name_var = rqlst.make_variable()  # CN
+            rqlst.make_variable()  # CN
             rqlst.add_relation(keyword_var, 'applied_to', mainvar)  # K applied_to X
             rqlst.add_relation(keyword_var, 'name', keyword_name_var)  # K name KN
             rqlst.add_relation(keyword_var, 'included_in', classif_var)  # K included_in C