#NEWLINE# def load_credentials( self , profile = 'default' ) : #NEWLINE# #INDENT# '\n        Loads crentials for a given profile. Profiles are stored in\n        ~/.db.py_{profile_name} and are a base64 encoded JSON file. This is not\n        to say this a secure way to store sensitive data, but it will probably\n        stop your little sister from stealing your passwords.\n\n        Parameters\n        ----------\n        profile: str\n            (optional) identifier/name for your database (i.e. "dw", "prod")\n        ' #NEWLINE# f = profile_path ( DBPY_PROFILE_ID , profile ) #NEWLINE# if f : #NEWLINE# #INDENT# creds = load_from_json ( f ) #NEWLINE# self . username = creds . get ( 'username' ) #NEWLINE# self . password = creds . get ( 'password' ) #NEWLINE# self . hostname = creds . get ( 'hostname' ) #NEWLINE# self . port = creds . get ( 'port' ) #NEWLINE# self . filename = creds . get ( 'filename' ) #NEWLINE# self . dbname = creds . get ( 'dbname' ) #NEWLINE# self . dbtype = creds . get ( 'dbtype' ) #NEWLINE# self . schemas = creds . get ( 'schemas' ) #NEWLINE# self . limit = creds . get ( 'limit' ) #NEWLINE# self . keys_per_column = creds . get ( 'keys_per_column' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( 'Credentials not configured!' )