#NEWLINE# def init_app( self , app ) : #NEWLINE# #INDENT# '\n        To initiate with Flask\n        :param app: Flask object\n        :return:\n        ' #NEWLINE# provider = app . config . get ( 'STORAGE_PROVIDER' , None ) #NEWLINE# key = app . config . get ( 'STORAGE_KEY' , None ) #NEWLINE# secret = app . config . get ( 'STORAGE_SECRET' , None ) #NEWLINE# container = app . config . get ( 'STORAGE_CONTAINER' , None ) #NEWLINE# allowed_extensions = app . config . get ( 'STORAGE_ALLOWED_EXTENSIONS' , None ) #NEWLINE# serve_files = app . config . get ( 'STORAGE_SERVER' , True ) #NEWLINE# serve_files_url = app . config . get ( 'STORAGE_SERVER_URL' , 'files' ) #NEWLINE# self . config [ 'serve_files' ] = serve_files #NEWLINE# self . config [ 'serve_files_url' ] = serve_files_url #NEWLINE# if ( not provider ) : #NEWLINE# #INDENT# raise ValueError ( "'STORAGE_PROVIDER' is missing" ) #NEWLINE# #UNINDENT# if ( provider . upper ( ) == 'LOCAL' ) : #NEWLINE# #INDENT# if ( not os . path . isdir ( container ) ) : #NEWLINE# #INDENT# raise IOError ( ( "Local Container (directory) '%s' is not a directory or doesn't exist for LOCAL provider" % container ) ) #NEWLINE# #UNINDENT# #UNINDENT# self . __init__ ( provider = provider , key = key , secret = secret , container = container , allowed_extensions = allowed_extensions ) #NEWLINE# self . _register_file_server ( app )