#NEWLINE# @ typecheck ( basestring ) #NEWLINE# def load( self , storage_path ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# content = open ( os . path . join ( storage_path , self . file_path ) , 'rb' ) . read ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# sio = StringIO . StringIO ( ) #NEWLINE# traceback . print_exc ( file = sio ) #NEWLINE# content = ( 'ERROR:File could not be retrieved. Reason: %s' % sio . getvalue ( ) ) #NEWLINE# #UNINDENT# content_serialized = base64 . encodestring ( content ) #NEWLINE# return LoadedFileSent ( content_serialized , self . timestamp_before , self . response , self . timestamp_after , self . file_info )