#NEWLINE# def add_link( self , source_option , target_option , allow_stream = True ) : #NEWLINE# #INDENT# 'Create an option link between the source option and the target\n        options. This also checks that the source_option source is the\n        same as the edges source._tool and the target_option source is\n        the same as the edges target._tool\n\n        :param source_option: the source option\n        :type source_option: jip.options.Option\n        :param target_option: the target option\n        :type target_option: jip.options.Option\n        ' #NEWLINE# if ( not ( source_option . source == self . _source . _tool ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Linked source options.source != edge.source' ) #NEWLINE# #UNINDENT# if ( not ( target_option . source == self . _target . _tool ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Linked target option.source != edge.target' ) #NEWLINE# #UNINDENT# if ( source_option . is_stream ( ) and ( not target_option . streamable ) ) : #NEWLINE# #INDENT# raise jip . tools . ValidationError ( self . _target . _tool , ( 'You are trying to establish a link between\n%s and %s, using %s.%s delegated to %s.%s.\nThe source is a <<STREAM>> but the target does not accept streamed input!\nTry to set file name as output for %s.' % ( self . _source , self . _target , self . _source , source_option . name , self . _target , target_option . name , self . _source ) ) ) #NEWLINE# #UNINDENT# link = ( source_option , target_option , ( allow_stream and source_option . streamable and target_option . streamable ) ) #NEWLINE# log . debug ( 'Add link on edge: %s->%s [%s->%s Stream:%s]' , source_option . _source , self . _target , source_option . name , target_option . name , link [ 2 ] ) #NEWLINE# self . _links . add ( link ) #NEWLINE# return link