#NEWLINE# def write_doc_submodule( self , filename , title = None , header = None , submodulename = None ) : #NEWLINE# #INDENT# ' Writes the docs only for the functions defined in a given\n            submodule. If submodule is none, all the non-processed\n            functions are processed.\n        ' #NEWLINE# outfile = file ( os . sep . join ( [ self . out_dir , outfile ] ) , 'w' ) #NEWLINE# if ( header is not None ) : #NEWLINE# #INDENT# outfile . write ( header ) #NEWLINE# #UNINDENT# outfile . write ( ( '\n\n.. currentmodule:: %s\n\n.. note::\n\n    This section is only a reference describing the function, please see\n    the chapter on :ref:`simple-scripting-with-mlab` for an introduction to\n    mlab and how to interact with and assemble the functions of `mlab`.\n\n    Please see the section on :ref:`running-mlab-scripts` for\n    instructions on running the examples.\n\n' % self . module . __name__ ) ) #NEWLINE# if ( title is not None ) : #NEWLINE# #INDENT# outfile . write ( ( title + '\n' ) ) #NEWLINE# outfile . write ( ( ( '=' * len ( title ) ) + '\n' ) ) #NEWLINE# #UNINDENT# documented = set ( ) #NEWLINE# for func_name in sorted ( self . to_document ) : #NEWLINE# #INDENT# func = getattr ( self . module , func_name ) #NEWLINE# if ( ( submodulename is not None ) and ( not ( func . __module__ == submodulename ) ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# outfile . write ( self . document_function ( func_name ) ) #NEWLINE# outfile . write ( '\n\n' ) #NEWLINE# documented . add ( func_name ) #NEWLINE# #UNINDENT# self . to_document . difference_update ( documented )