예제 #1
0
def image_copy(img: Image, uri: str) -> Image:
    """Copy the image to a new destination, specified by the URI.

    Parameters
    ----------
    img : Image
        An image object
    uri : str
        The base directory to copy the image to.

    Return
    ------
    Image
        Return a new image pointed to the new URI
    """
    logger.info("Copying image src=%s dest=%s", img.uri, uri)
    return Image(_copy(img.uri, uri))
예제 #2
0
파일: functions.py 프로젝트: AdaZhou/rikai
def copy(source: str, dest: str) -> str:
    """Copy a file from source to dest

    Parameters
    ----------
    source : str
        The source URI to copy from
    dest : str
        The destination uri or the destionation directory. If ``dest`` is a URI ends with a "/",
        it represents a directory.

    Return
    ------
    str
        Return the URI of destination.
    """
    return _copy(source, dest)