#NEWLINE# def link_set( self , rel , href , allow_duplicates = False , **atts ) : #NEWLINE# #INDENT# 'Set/create link with specified rel, set href and any other attributes\n\n        Any link element must have both rel and href values, the specification\n        also defines the type attributes and others are permitted also. See \n        description of allowed formats in\n\n        http://www.openarchives.org/rs/resourcesync.html#DocumentFormats\n\n        Be aware that adding links to a Resource object will \n        significantly increase the size of the object.\n        ' #NEWLINE# if ( self . ln is None ) : #NEWLINE# #INDENT# self . ln = [ ] #NEWLINE# link = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# link = self . link ( rel ) #NEWLINE# #UNINDENT# if ( ( link is not None ) and ( not allow_duplicates ) ) : #NEWLINE# #INDENT# link [ 'href' ] = href #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# link = { #NEWLINE# #INDENT# 'rel' : rel , #NEWLINE# 'href' : href , #NEWLINE# #UNINDENT# } #NEWLINE# self . ln . append ( link ) #NEWLINE# #UNINDENT# for k in atts : #NEWLINE# #INDENT# link [ k ] = atts [ k ]