#NEWLINE# def PlaceNeededFiles( self , target_dir ) : #NEWLINE# #INDENT# 'Populates necessary files into the gslib module and unit test modules.' #NEWLINE# target_dir = os . path . join ( target_dir , 'gslib' ) #NEWLINE# self . mkpath ( target_dir ) #NEWLINE# with open ( os . path . join ( target_dir , 'VERSION' ) , 'w' ) as fp : #NEWLINE# #INDENT# fp . write ( VERSION ) #NEWLINE# #UNINDENT# with open ( os . path . join ( target_dir , 'CHECKSUM' ) , 'w' ) as fp : #NEWLINE# #INDENT# fp . write ( CHECKSUM ) #NEWLINE# #UNINDENT# tests_dir = os . path . join ( target_dir , 'tests' ) #NEWLINE# self . mkpath ( tests_dir ) #NEWLINE# mock_storage_dst = os . path . join ( tests_dir , 'mock_storage_service.py' ) #NEWLINE# mock_storage_src1 = os . path . join ( BOTO_DIR , 'tests' , 'integration' , 's3' , 'mock_storage_service.py' ) #NEWLINE# mock_storage_src2 = os . path . join ( CURDIR , 'gslib' , 'tests' , 'mock_storage_service.py' ) #NEWLINE# mock_storage_src = ( mock_storage_src1 if os . path . isfile ( mock_storage_src1 ) else mock_storage_src2 ) #NEWLINE# if ( not os . path . isfile ( mock_storage_src ) ) : #NEWLINE# #INDENT# raise Exception ( ( 'Unable to find required boto test source file at %s or %s.' % ( mock_storage_src , mock_storage_src2 ) ) ) #NEWLINE# #UNINDENT# with open ( mock_storage_src , 'r' ) as fp : #NEWLINE# #INDENT# mock_storage_contents = fp . read ( ) #NEWLINE# #UNINDENT# with open ( mock_storage_dst , 'w' ) as fp : #NEWLINE# #INDENT# fp . write ( '#\n# This file was copied during gsutil package generation from\n# the Boto test suite, originally located at:\n#   tests/integration/s3/mock_storage_service.py\n# DO NOT MODIFY\n#\n\n' ) #NEWLINE# fp . write ( mock_storage_contents )