def format_class(name, class_, docstring=None):
 template = '.. py:class:: ckan.plugins.toolkit.{cls}\n\n{docstring}\n\n'
 docstring = (docstring or inspect.getdoc(class_))
 if (docstring is None):
  docstring = ''
 else:
  docstring = '\n'.join([('   ' + line) for line in docstring.split('\n')])
 return template.format(cls=name, docstring=docstring)

def format_class ( name , class_ , docstring = None ) : template = '.. py:class:: ckan.plugins.toolkit.{cls}\n\n{docstring}\n\n' docstring = ( docstring or inspect . getdoc ( class_ ) ) if ( docstring is None ) : docstring = '' else : docstring = '\n' . join ( [ ( '   ' + line ) for line in docstring . split ( '\n' ) ] ) return template . format ( cls = name , docstring = docstring )
return a sphinx .