pyega3/libs/server_config.py
def from_file(filepath):
        """Load server config for EMBL/EBI EGA from specified file"""
        filepath = os.path.expanduser(filepath)
        if not os.path.exists(filepath):
            logging.error(f"{filepath} does not exist")
            sys.exit()

        try:
            with open(filepath) as f:
                custom_server_config = json.load(f)

            def check_key(key):
                if key not in custom_server_config:
                    logging.error(f"{filepath} does not contain '{key}' field")
                    sys.exit()

            check_key('url_auth')
            check_key('url_api')
            check_key('url_api_ticket')
            check_key('client_secret')

            return ServerConfig(custom_server_config['url_api'],
                                custom_server_config['url_auth'],
                                custom_server_config['url_api_ticket'],
                                custom_server_config['client_secret'])

        except ValueError:
            logging.error("Invalid server config JSON file")
            sys.exit()
Load server config for EMBL/EBI EGA from specified file
Load server config for EMBL/EBI EGA from specified file
Load server config for EMBL / EBI EGA from specified file
def from_file(filepath):
        filepath = os.path.expanduser(filepath)
        if not os.path.exists(filepath):
            logging.error(f"{filepath} does not exist")
            sys.exit()
        try:
            with open(filepath) as f:
                custom_server_config = json.load(f)
            def check_key(key):
                if key not in custom_server_config:
                    logging.error(f"{filepath} does not contain '{key}' field")
                    sys.exit()
            check_key('url_auth')
            check_key('url_api')
            check_key('url_api_ticket')
            check_key('client_secret')
            return ServerConfig(custom_server_config['url_api'],
                                custom_server_config['url_auth'],
                                custom_server_config['url_api_ticket'],
                                custom_server_config['client_secret'])
        except ValueError:
            logging.error("Invalid server config JSON file")
            sys.exit()
def from_file ( filepath ) : filepath = os . path . expanduser ( filepath ) if not os . path . exists ( filepath ) : logging . error ( f"{filepath} does not exist" ) sys . exit ( ) try : with open ( filepath ) as f : custom_server_config = json . load ( f ) def check_key ( key ) : if key not in custom_server_config : logging . error ( f"{filepath} does not contain '{key}' field" ) sys . exit ( ) check_key ( 'url_auth' ) check_key ( 'url_api' ) check_key ( 'url_api_ticket' ) check_key ( 'client_secret' ) return ServerConfig ( custom_server_config [ 'url_api' ] , custom_server_config [ 'url_auth' ] , custom_server_config [ 'url_api_ticket' ] , custom_server_config [ 'client_secret' ] ) except ValueError : logging . error ( "Invalid server config JSON file" ) sys . exit ( )
Load server config for EMBL/EBI EGA from specified file
Load server config for EMBL / EBI EGA from specified file
"""Load server config for EMBL/EBI EGA from specified file"""
filepath