<s> import IECore <EOL> from Gaffer import About <EOL> import sys , os <EOL> targetDoc = open ( '<STR_LIT>' , '<STR_LIT:w>' ) <EOL> targetDoc . write ( '<STR_LIT>' ) <EOL> licensePath = About . license ( ) . replace ( '<STR_LIT>' , os . environ [ '<STR_LIT>' ] ) <EOL> if os . path . exists ( licensePath ) : <EOL> with open ( licensePath , '<STR_LIT:r>' ) as fh : <EOL> license = fh . read ( ) <EOL> targetDoc . write ( '<STR_LIT:%s>' % ( license ) ) <EOL> targetDoc . write ( '<STR_LIT>' ) <EOL> targetDoc . write ( About . dependenciesPreamble ( ) ) <EOL> blockDelimiter = '<STR_LIT>' <EOL> for dependency in About . dependencies ( ) : <EOL> targetDoc . write ( '<STR_LIT>' % ( dependency [ '<STR_LIT:name>' ] ) ) <EOL> if '<STR_LIT>' in dependency : <EOL> targetDoc . write ( '<STR_LIT>' % ( dependency [ '<STR_LIT>' ] ) ) <EOL> if '<STR_LIT:url>' in dependency : <EOL> targetDoc . write ( '<STR_LIT>' % ( dependency [ '<STR_LIT:url>' ] ) ) <EOL> if '<STR_LIT>' in dependency : <EOL> licensePath = dependency [ '<STR_LIT>' ] . replace ( '<STR_LIT>' , os . environ [ '<STR_LIT>' ] ) <EOL> if os . path . exists ( licensePath ) : <EOL> with open ( licensePath , '<STR_LIT:r>' ) as fh : <EOL> license = fh . read ( ) <EOL> targetDoc . write ( '<STR_LIT>' % ( blockDelimiter , license , blockDelimiter ) ) </s>
