# HG changeset patch # User Julien Cristau # Date 1386779819 -3600 # Node ID cfd5d793ac8978144ae6852b4bbe28252392cde6 # Parent 480600497e2d4af2a72267e03487a0bf7dafa04e [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 diff -r 480600497e2d -r cfd5d793ac89 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