Commit 5cd00f8c authored by Noé Gaumont's avatar Noé Gaumont 🐙
Browse files

[autopep8] E302 - Add missing 2 blank lines

parent 4850d6de0db2
......@@ -18,6 +18,7 @@ __docformat__ = "restructuredtext en"
from cubicweb.entities.adapters import ITreeAdapter
class TVITreeAdapter(ITreeAdapter):
def is_editable_leaf(self):
return len(self.same_type_children()) == 0
......@@ -25,6 +26,7 @@ class TVITreeAdapter(ITreeAdapter):
def editable_children(self, entities=False):
return self.same_type_children(entities=entities)
def registration_callback(vreg):
vreg.register_all(globals().values(), __name__, (TVITreeAdapter,))
vreg.register_and_replace(TVITreeAdapter, ITreeAdapter)
......@@ -25,6 +25,7 @@ from logilab.mtconverter import xml_escape
from cubicweb import tags
from cubicweb.web import formwidgets as fwdgs
class TreeViewWidget(fwdgs.FieldWidget):
"""form widget to link to keywords of a given classification"""
......
......@@ -27,6 +27,7 @@ from cubicweb.predicates import is_instance, match_kwargs, adaptable
from cubicweb.web.views import baseviews, treeview
from cubicweb.uilib import cut
class TVTreeViewItemView(treeview.TreeViewItemView):
def _is_leaf(self, itree):
......@@ -94,6 +95,7 @@ class TVTreeViewItemView(treeview.TreeViewItemView):
treeid=treeid, initial_load=False, **morekwargs)
w(u'</li>')
class TVDefaultTreeViewItemView(treeview.DefaultTreeViewItemView):
def cell_call(self, row, col, vid='oneline', treeid=None, **morekwargs):
......@@ -106,6 +108,7 @@ class TVDefaultTreeViewItemView(treeview.DefaultTreeViewItemView):
liclasses.append('last')
self.w(u'<li class="%s">%s</li>' % (u' '.join(liclasses), itemview))
class TVTreeViewEditItemView(TVTreeViewItemView):
"""keeps track of which branches to open according to the X rtype
Y value given to the TreeView
......@@ -132,6 +135,7 @@ class TVTreeViewEditItemView(TVTreeViewItemView):
def _children(self, itree):
return itree.editable_children(entities=False)
class TVTreeEditView(treeview.TreeView):
__regid__ = 'treeview_edit'
subvid = 'oneline_edit'
......@@ -147,6 +151,7 @@ class TVTreeEditView(treeview.TreeView):
form.pop('fname')
return super(TVTreeEditView, self)._init_params(subvid, treeid, initial_load, initial_thru_ajax, morekwargs)
class TVNotTreeEditView(treeview.DefaultTreeViewItemView):
__regid__ = 'treeview_edit'
__select__ = ~adaptable('ITree')
......@@ -155,6 +160,7 @@ class TVNotTreeEditView(treeview.DefaultTreeViewItemView):
def cell_call(self, row, col, vid='oneline', treeid=None, **morekwargs):
return u''
class TVNotTreeviewOneLineEditView(baseviews.InContextView):
__regid__ = 'oneline_edit'
__select__ = ~adaptable('ITree')
......@@ -163,6 +169,7 @@ class TVNotTreeviewOneLineEditView(baseviews.InContextView):
leavesonly, related, required, level):
return u''
class TVTreeviewOneLineEditView(baseviews.InContextView):
__regid__ = 'oneline_edit'
__select__ = adaptable('ITree')
......@@ -210,6 +217,7 @@ class TVTreeviewOneLineEditView(baseviews.InContextView):
return itree.level
return None
def registration_callback(vreg):
vreg.register_all(globals().values(), __name__, (
TVTreeViewItemView,
......
......@@ -23,6 +23,7 @@ import sys
from logilab.common.pytest import PyTester
def getlogin():
"""avoid usinng os.getlogin() because of strange tty / stdin problems
(man 3 getlogin)
......
......@@ -17,6 +17,7 @@
"""cubicweb-treeview automatic tests"""
from cubicweb.devtools.testlib import AutomaticWebTest
class AutomaticWebTest(AutomaticWebTest):
'''provides `to_test_etypes` and/or `list_startup_views` implementation
to limit test scope
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment