#NEWLINE# def get_document_class( doctype = None , mimetype = None ) : #NEWLINE# #INDENT# if doctype : #NEWLINE# #INDENT# dtobject = dtds . get_doctype ( dtobject ) #NEWLINE# if dtobject : #NEWLINE# #INDENT# return _DOCMAP . get ( dtobject . name . lower ( ) , ( GenericDocument , doctype ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( GenericDocument , None ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if mimetype : #NEWLINE# #INDENT# return _DOCMAP . get ( mimetype , ( GenericDocument , dtds . XHTML1_TRANSITIONAL ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'You must supply a doctype or a mimetime' )