#NEWLINE# def moveModule( ) : #NEWLINE# #INDENT# global moduleToMove #NEWLINE# global context #NEWLINE# global moveConfig #NEWLINE# context . window . run_command ( 'close_file' ) #NEWLINE# if ( moduleToMove . type is 'text' ) : #NEWLINE# #INDENT# current = ( ( context . settings [ 'text_folder' ] + '/' ) + moveConfig [ 'importString' ] ) #NEWLINE# new = ( ( context . settings [ 'text_folder' ] + '/' ) + moveConfig [ 'newImportString' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# current = ( ( context . settings [ 'script_folder' ] + '/' ) + moveConfig [ 'importString' ] ) #NEWLINE# new = ( ( context . settings [ 'script_folder' ] + '/' ) + moveConfig [ 'newImportString' ] ) #NEWLINE# #UNINDENT# newFullPath = moduleToMove . getFullPath ( ) . replace ( current , new ) #NEWLINE# dir = os . path . dirname ( newFullPath ) #NEWLINE# if ( not os . path . exists ( dir ) ) : #NEWLINE# #INDENT# os . makedirs ( dir ) #NEWLINE# #UNINDENT# os . rename ( moduleToMove . getFullPath ( ) , newFullPath ) #NEWLINE# context . window . open_file ( newFullPath ) #NEWLINE# pass