#NEWLINE# def write_shared_locations( self , paths , dry_run = False ) : #NEWLINE# #INDENT# '\n        Write shared location information to the SHARED file in .dist-info.\n        :param paths: A dictionary as described in the documentation for\n        :meth:`shared_locations`.\n        :param dry_run: If True, the action is logged but no file is actually\n                        written.\n        :return: The path of the file written to.\n        ' #NEWLINE# shared_path = os . path . join ( self . path , 'SHARED' ) #NEWLINE# logger . info ( 'creating %s' , shared_path ) #NEWLINE# if shared_path : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# lines = [ ] #NEWLINE# for key in ( 'prefix' , 'lib' , 'headers' , 'scripts' , 'data' ) : #NEWLINE# #INDENT# path = paths [ key ] #NEWLINE# if os . path . isdir ( paths [ key ] ) : #NEWLINE# #INDENT# lines . append ( ( '%s=%s' % ( key , path ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# for ns in paths . get ( 'namespace' , ( ) ) : #NEWLINE# #INDENT# lines . append ( ( 'namespace=%s' % ns ) ) #NEWLINE# #UNINDENT# with codecs . open ( shared_path , 'w' , encoding = 'utf-8' ) as f : #NEWLINE# #INDENT# f . write ( '\n' . join ( lines ) ) #NEWLINE# #UNINDENT# return shared_path