debian/cubicweb-ctl.manpages
author |
Denis Laxalde <denis.laxalde@logilab.fr> |
|
Thu, 28 Jun 2018 11:19:14 +0200 |
branch | 3.26 |
changeset 12336 |
90ff36da4c8e |
parent 0 |
b97547f5f1fa
|
permissions |
-rw-r--r-- |
[py3] Avoid setting attribute on Element instance in wdoc view
This change is needed to make "wdoc" view work on Python 3. Indeed,
before this patch, we used to set a "parent" attribute on Element
instances, which is not permitted since Python 3.3 as
xml.etree.ElementTree uses the C implementation by default.
To get rid of this "parent" attribute, we rework the XML nodes
processing logic to return and retrieve a node along with its parent in
several place of the code. Namely, build_toc_index() now accepts the
"parent" value for "node" and inserts it in the "index" dict (thus avoid
`node.parent = <value>`). Respectively, every query to the "index" dict
is updated to also retrieve the "parent" (thus avoiding `<value> =
node.parent`). Later in InlineHelpView class, the "index" dict is bound
to "tocindex" attribute so we adjust how it is queried in respective
methods.
Tests cubicweb/web/test/unittest_views_wdoc.py now pass on Python 3.
0
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff
changeset
|
1 |
man/cubicweb-ctl.1
|