#NEWLINE# def execute( self , pipedata ) : #NEWLINE# #INDENT# if pipedata . get ( 'license_file' , None ) : #NEWLINE# #INDENT# license_file_in_full_path = pipedata [ 'license_file' ] #NEWLINE# license_file_in = license_file_in_full_path . split ( '/' ) [ ( - 1 ) ] #NEWLINE# list_of_ofl_filenames = [ 'Open Font License.markdown' , 'OFL.txt' , 'OFL.md' ] #NEWLINE# listOfApacheFilenames = [ 'APACHE.txt' , 'LICENSE' ] #NEWLINE# if ( license_file_in in list_of_ofl_filenames ) : #NEWLINE# #INDENT# license_file_out = 'OFL.txt' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( license_file_in in listOfApacheFilenames ) : #NEWLINE# #INDENT# license_file_out = 'LICENSE.txt' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# license_file_out = license_file_in #NEWLINE# #UNINDENT# #UNINDENT# _in_license = op . join ( self . project_root , license_file_in_full_path ) #NEWLINE# _out_license = op . join ( self . builddir , license_file_out ) #NEWLINE# try : #NEWLINE# #INDENT# shellutil . copy ( _in_license , _out_license ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for lic in self . supported_licenses : #NEWLINE# #INDENT# src = op . join ( self . project_root , lic ) #NEWLINE# dest = op . join ( self . builddir , 'sources' , lic ) #NEWLINE# if os . path . exists ( src ) : #NEWLINE# #INDENT# shellutil . copy ( src , dest ) #NEWLINE# pipedata [ 'license_file' ] = lic #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return pipedata