Re: [sphinx-dev] Decorators

2012-09-05 Thread Jonathan Fine
It may be possible to fix this by wrapping the decorator.  I'm reading you
problem to mean that you wrote the module, and that you are using third
party decorators.

Instead of

@wibble
def fn():
   '''Docstring'''

perhaps try

@wobble(wibble)
def fn():
   '''Docstring'

Here @wibble is the third party decorator, and @wobble is your own
decorator wrapper, which picks up the docstring from fn, applies wibble to
fn, and then adds the docstring to the result of applying wibble to fn.
You'll have to know how to code decorators that take arguments in order to
implement @wobble.  It should go something like this (not tested)

def wobble(decorator):
def next(fn):
  decorated = decorator(fn)
  decorated.__doc__ = fn.__doc__
  return decorated
 return next

I hope this helps.   If it does, choose a better name than @wobble.


Jonathan

On Mon, Aug 27, 2012 at 8:29 PM, Larry G. Wapnitsky la...@kvetsch.comwrote:

 Has there been any further documentation on how to deal with decorated
 functions and Sphinx?  I have an entire module filled with
 third-party-decorated functions that can't be auto-documented, hence adding
 a ton of extra work that should not need to be done.

 Thanks,
 Larry

  --
 You received this message because you are subscribed to the Google Groups
 sphinx-dev group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/sphinx-dev/-/Spv2LbfJ84sJ.
 To post to this group, send email to sphinx-dev@googlegroups.com.
 To unsubscribe from this group, send email to
 sphinx-dev+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/sphinx-dev?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
sphinx-dev group.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.



[sphinx-dev] Decorators

2012-09-01 Thread Larry G. Wapnitsky
Has there been any further documentation on how to deal with decorated 
functions and Sphinx?  I have an entire module filled with 
third-party-decorated functions that can't be auto-documented, hence adding 
a ton of extra work that should not need to be done.

Thanks,
Larry

-- 
You received this message because you are subscribed to the Google Groups 
sphinx-dev group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sphinx-dev/-/Spv2LbfJ84sJ.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.