#NEWLINE# def open( self , mode = 'r' ) : #NEWLINE# #INDENT# rwmode = mode . replace ( 'b' , '' ) . replace ( 't' , '' ) #NEWLINE# if ( rwmode == 'w' ) : #NEWLINE# #INDENT# self . makedirs ( ) #NEWLINE# return self . format . pipe_writer ( atomic_file ( self . path ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( rwmode == 'r' ) : #NEWLINE# #INDENT# fileobj = FileWrapper ( io . BufferedReader ( io . FileIO ( self . path , mode ) ) ) #NEWLINE# return self . format . pipe_reader ( fileobj ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( ( 'mode must be r/w (got:%s)' % mode ) )