#NEWLINE# def SaveCredentialsFile( self , credentials_file = None ) : #NEWLINE# #INDENT# 'Saves credentials to the file in JSON format.\n\n    :param credentials_file: destination to save file to.\n    :type credentials_file: str.\n    :raises: InvalidConfigError, InvalidCredentialsError\n    ' #NEWLINE# if ( self . credentials is None ) : #NEWLINE# #INDENT# raise InvalidCredentialsError ( 'No credentials to save' ) #NEWLINE# #UNINDENT# if ( credentials_file is None ) : #NEWLINE# #INDENT# credentials_file = self . settings . get ( 'save_credentials_file' ) #NEWLINE# if ( credentials_file is None ) : #NEWLINE# #INDENT# raise InvalidConfigError ( 'Please specify credentials file to read' ) #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# storage = Storage ( storage ) #NEWLINE# storage . put ( self . credentials ) #NEWLINE# self . credentials . set_store ( storage ) #NEWLINE# #UNINDENT# except CredentialsFileSymbolicLinkError : #NEWLINE# #INDENT# raise InvalidCredentialsError ( 'Credentials file cannot be symbolic link' )