#NEWLINE# def _find_form_ids( el ) : #NEWLINE# #INDENT# forms = _forms_xpath ( el ) #NEWLINE# if ( not forms ) : #NEWLINE# #INDENT# ( yield '(no forms)' ) #NEWLINE# return #NEWLINE# #UNINDENT# for ( index , form ) in enumerate ( forms ) : #NEWLINE# #INDENT# if form . get ( 'id' ) : #NEWLINE# #INDENT# if form . get ( 'name' ) : #NEWLINE# #INDENT# ( yield ( '%s or %s' % ( form . get ( 'id' ) , form . get ( 'name' ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( yield form . get ( 'id' ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if form . get ( 'name' ) : #NEWLINE# #INDENT# ( yield form . get ( 'name' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( yield ( '(unnamed form %s)' % index ) )