#NEWLINE# def _ipython_dir_changed( self , name , old , new ) : #NEWLINE# #INDENT# if ( old in sys . path ) : #NEWLINE# #INDENT# sys . path . remove ( old ) #NEWLINE# #UNINDENT# sys . path . append ( os . path . abspath ( new ) ) #NEWLINE# if ( not os . path . isdir ( new ) ) : #NEWLINE# #INDENT# os . makedirs ( new , mode = 511 ) #NEWLINE# #UNINDENT# readme = os . path . join ( new , 'README' ) #NEWLINE# if ( not os . path . exists ( readme ) ) : #NEWLINE# #INDENT# path = os . path . join ( get_ipython_package_dir ( ) , 'config' , 'profile' ) #NEWLINE# shutil . copy ( os . path . join ( path , 'README' ) , readme ) #NEWLINE# #UNINDENT# self . log . debug ( ( 'IPYTHON_DIR set to: %s' % new ) )