#NEWLINE# def ensure_dir( self , path ) : #NEWLINE# #INDENT# path = os . path . abspath ( path ) #NEWLINE# if ( ( path not in self . ensured ) and ( not os . path . exists ( path ) ) ) : #NEWLINE# #INDENT# self . ensured . add ( path ) #NEWLINE# ( d , f ) = os . path . split ( path ) #NEWLINE# self . ensure_dir ( d ) #NEWLINE# logger . info ( ( 'Creating %s' % path ) ) #NEWLINE# if ( not self . dry_run ) : #NEWLINE# #INDENT# os . mkdir ( path ) #NEWLINE# #UNINDENT# if self . record : #NEWLINE# #INDENT# self . dirs_created . add ( path )