seagull/lifeforms/wiki.py
def _load_file_of_url(path: str) -> str:
    """Detects if path is local or URL, loads file content

    Args:
        path (str): [description]

    Returns:
        str: [description]
    """
    if isfile(path):
        logger.trace(f"reading from file [{path}]..", end="")
        with open(path, "r") as f:
            content = f.read()
        logger.trace("ok")
    elif urlparse(path).scheme in {"ftp", "http", "https"}:
        logger.trace(f"trying to download [{path}]..", end="")
        req = urlopen(path)
        if req.getcode() != 200:
            raise ValueError(
                f"Invalid input URL request returned {req.getcode()}"
            )
        logger.trace("ok")
        content = req.read().decode("utf-8")
    else:
        raise ValueError(f"Unrecognized input path {path}")

    return content
Detects if path is local or URL, loads file content

    Args:
        path (str): [description]

    Returns:
        str: [description]
    
Detects if path is local or URL, loads file content
Detects if path is local or URL loads file content
def _load_file_of_url(path: str) -> str:
    if isfile(path):
        logger.trace(f"reading from file [{path}]..", end="")
        with open(path, "r") as f:
            content = f.read()
        logger.trace("ok")
    elif urlparse(path).scheme in {"ftp", "http", "https"}:
        logger.trace(f"trying to download [{path}]..", end="")
        req = urlopen(path)
        if req.getcode() != 200:
            raise ValueError(
                f"Invalid input URL request returned {req.getcode()}"
            )
        logger.trace("ok")
        content = req.read().decode("utf-8")
    else:
        raise ValueError(f"Unrecognized input path {path}")
    return content
def _load_file_of_url ( path : str ) -> str : if isfile ( path ) : logger . trace ( f"reading from file [{path}].." , end = "" ) with open ( path , "r" ) as f : content = f . read ( ) logger . trace ( "ok" ) elif urlparse ( path ) . scheme in { "ftp" , "http" , "https" } : logger . trace ( f"trying to download [{path}].." , end = "" ) req = urlopen ( path ) if req . getcode ( ) != 200 : raise ValueError ( f"Invalid input URL request returned {req.getcode()}" ) logger . trace ( "ok" ) content = req . read ( ) . decode ( "utf-8" ) else : raise ValueError ( f"Unrecognized input path {path}" ) return content
Detects if path is local or URL, loads file content
Detects if path is local or URL loads file content
"""Detects if path is local or URL, loads file content

    Args:
        path (str): [description]

    Returns:
        str: [description]
    """
None
str
path
str
None