#NEWLINE# def processLinkDefaults( lds , doc ) : #NEWLINE# #INDENT# for ld in lds : #NEWLINE# #INDENT# if ( len ( ld . get ( 'type' , [ ] ) ) != 1 ) : #NEWLINE# #INDENT# die ( 'Every link default needs exactly one type. Got:\n{0}' , config . printjson ( ld ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# type = ld [ 'type' ] [ 0 ] #NEWLINE# #UNINDENT# if ( len ( ld . get ( 'spec' , [ ] ) ) != 1 ) : #NEWLINE# #INDENT# die ( 'Every link default needs exactly one spec. Got:\n{0}' , config . printjson ( ld ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# spec = ld [ 'spec' ] [ 0 ] #NEWLINE# #UNINDENT# if ( len ( ld . get ( 'text' , [ ] ) ) != 1 ) : #NEWLINE# #INDENT# die ( 'Every link default needs exactly one text. Got:\n{0}' , config . printjson ( text ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# text = ld [ 'text' ] [ 0 ] #NEWLINE# #UNINDENT# if ( 'for' in ld ) : #NEWLINE# #INDENT# for _for in ld [ 'for' ] : #NEWLINE# #INDENT# doc . md . linkDefaults [ text ] . append ( ( spec , type , ld . get ( 'status' , None ) , _for ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# doc . md . linkDefaults [ text ] . append ( ( spec , type , ld . get ( 'status' , None ) , None ) ) #NEWLINE# #UNINDENT# #UNINDENT# return [ ]