[book] fix Session.{set,free}_cnxset autodoc stable
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 11 Dec 2013 17:36:59 +0100
branchstable
changeset 9351 cfd5d793ac89
parent 9350 480600497e2d
child 9352 26c979b24196
[book] fix Session.{set,free}_cnxset autodoc They're Session methods, not bare functions. Without this building the docs says: reading sources... [ 39%] devrepo/repo/sessions Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/sphinx/ext/autodoc.py", line 326, in import_object obj = self.get_attr(obj, part) File "/usr/lib/pymodules/python2.7/sphinx/ext/autodoc.py", line 232, in get_attr return safe_getattr(obj, name, *defargs) File "/usr/lib/pymodules/python2.7/sphinx/util/inspect.py", line 70, in safe_getattr raise AttributeError(name) AttributeError: set_cnxset Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/sphinx/ext/autodoc.py", line 326, in import_object obj = self.get_attr(obj, part) File "/usr/lib/pymodules/python2.7/sphinx/ext/autodoc.py", line 232, in get_attr return safe_getattr(obj, name, *defargs) File "/usr/lib/pymodules/python2.7/sphinx/util/inspect.py", line 70, in safe_getattr raise AttributeError(name) AttributeError: free_cnxset
server/session.py
--- a/server/session.py	Wed Nov 27 22:16:26 2013 +0100
+++ b/server/session.py	Wed Dec 11 17:36:59 2013 +0100
@@ -711,6 +711,7 @@
     This is to be used by session"""
     def meth_from_tx(session, *args, **kwargs):
         return getattr(session._tx, meth_name)(*args, **kwargs)
+    meth_from_tx.__doc__ = getattr(Transaction, meth_name).__doc__
     return meth_from_tx
 
 
@@ -767,8 +768,8 @@
       used by another session as long as no writing is done. This means we can
       have multiple sessions with a reasonably low connections set pool size.
 
-    .. automethod:: cubicweb.server.session.set_cnxset
-    .. automethod:: cubicweb.server.session.free_cnxset
+      .. automethod:: cubicweb.server.session.Session.set_cnxset
+      .. automethod:: cubicweb.server.session.Session.free_cnxset
 
       :attr:`mode`, string telling the connections set handling mode, may be one
       of 'read' (connections set may be freed), 'write' (some write was done in