#NEWLINE# def __enter__( self ) : #NEWLINE# #INDENT# self . logger . info ( 'Creating app: %s [%s]' , self . appName , self . appTempPath ) #NEWLINE# if ( not os . path . exists ( self . appTempPath ) ) : #NEWLINE# #INDENT# os . makedirs ( self . appTempPath ) #NEWLINE# #UNINDENT# for subfolder in EMPTY_SUBFOLDERS : #NEWLINE# #INDENT# pathname = '{}/{}' . format ( self . appTempPath , self ) #NEWLINE# if ( not os . path . exists ( pathname ) ) : #NEWLINE# #INDENT# self . logger . info ( 'Creating folder: [%s]' , pathname ) #NEWLINE# os . makedirs ( pathname ) #NEWLINE# #UNINDENT# #UNINDENT# for subfolder in LINKED_SUBFOLDERS : #NEWLINE# #INDENT# pathname = '{}/{}' . format ( self . appTempPath , subfolder ) #NEWLINE# if ( not os . path . exists ( pathname ) ) : #NEWLINE# #INDENT# self . logger . info ( 'Linking folder: [%s]' , pathname ) #NEWLINE# os . symlink ( '{}/{}' . format ( RELATIVE_SERVER_SRC , subfolder ) , pathname ) #NEWLINE# #UNINDENT# #UNINDENT# filename = '{}/__init__.py' . format ( self . appTempPath ) #NEWLINE# if ( not os . path . exists ( filename ) ) : #NEWLINE# #INDENT# self . logger . info ( 'Creating file: [%s]' , filename ) #NEWLINE# with open ( filename , 'w' ) as f : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# return self