Returns the needed text to automatically document a class in RSF/sphinx

def GetClassText(heading, name, showprivate=False, showinh=False):
        """Returns the needed text to automatically document a class in RSF/sphinx"""
        und = '-'*len(heading)
        avail = [':private-members:', ':inherited-members:']
        opts = []
        if showprivate:
            opts.append(avail[0])
        if showinh:
            opts.append(avail[1])
        opts = '\n'.join(opts)
        return r'''

%s
%s

.. autoclass:: %s
    :show-inheritance:
    :members:
    :undoc-members:
    %s

''' % (heading, und, name, opts)