pyega3/libs/credentials.py
def from_file(filepath):
        """Load credentials for EMBL/EBI EGA from specified file"""
        result = Credentials()
        filepath = os.path.expanduser(filepath)
        if not os.path.exists(filepath):
            logging.error(f"{filepath} does not exist")
        else:
            try:
                with open(filepath) as f:
                    cfg = json.load(f)

                if 'username' in cfg:
                    result.username = cfg['username']
                if 'password' in cfg:
                    result.password = cfg['password']

            except ValueError:
                logging.error("Invalid credential config JSON file")
                sys.exit()

        result.prompt_for_missing_values()

        return result
Load credentials for EMBL/EBI EGA from specified file
Load credentials for EMBL/EBI EGA from specified file
Load credentials for EMBL / EBI EGA from specified file
def from_file(filepath):
        result = Credentials()
        filepath = os.path.expanduser(filepath)
        if not os.path.exists(filepath):
            logging.error(f"{filepath} does not exist")
        else:
            try:
                with open(filepath) as f:
                    cfg = json.load(f)
                if 'username' in cfg:
                    result.username = cfg['username']
                if 'password' in cfg:
                    result.password = cfg['password']
            except ValueError:
                logging.error("Invalid credential config JSON file")
                sys.exit()
        result.prompt_for_missing_values()
        return result
def from_file ( filepath ) : result = Credentials ( ) filepath = os . path . expanduser ( filepath ) if not os . path . exists ( filepath ) : logging . error ( f"{filepath} does not exist" ) else : try : with open ( filepath ) as f : cfg = json . load ( f ) if 'username' in cfg : result . username = cfg [ 'username' ] if 'password' in cfg : result . password = cfg [ 'password' ] except ValueError : logging . error ( "Invalid credential config JSON file" ) sys . exit ( ) result . prompt_for_missing_values ( ) return result
Load credentials for EMBL/EBI EGA from specified file
Load credentials for EMBL / EBI EGA from specified file
"""Load credentials for EMBL/EBI EGA from specified file"""
filepath