示例#1
0
文件: __init__.py 项目: JGoutin/nun
def extract(
    resources, output=".", debug=False, trusted=False, strip_components=0, force=False
):
    """
    Extract resources.

    Args:
        resources (iterable of str): Resources URLs.
        output (path-like object): Output path.
        debug (bool): If True, show full error traceback and stop on first error.
        trusted (bool): If True, allow extraction of files outside of the output
            directory. Default to False, because this can be a security issue if
            extracted from an untrusted source.
        strip_components (int): strip NUMBER leading components from file path on
            extraction.
        force (bool): Replace any existing destination even if modified by user.
    """
    with _Tsk(
        resources,
        "extract",
        output=output,
        debug=debug,
        force=force,
        trusted=trusted,
        strip_components=strip_components,
    ) as tsk:
        tsk.apply()
示例#2
0
文件: __init__.py 项目: JGoutin/nun
def remove(resources="*", debug=False):
    """
    Remove resources.

    Args:
        resources (iterable of str): Resources URLs.
        debug (bool): If True, show full error traceback and stop on first error.
    """
    with _Tsk(resources, "remove", debug=debug) as tsk:
        tsk.apply()
示例#3
0
文件: __init__.py 项目: JGoutin/nun
def update(resources="*", debug=False, force=False):
    """
    Update resources.

    Args:
        resources (iterable of str): Resources URLs.
        debug (bool): If True, show full error traceback and stop on first error.
        force (bool): Replace any existing destination even if modified by user.
    """
    with _Tsk(resources, "update", debug=debug, force=force) as tsk:
        tsk.apply()
示例#4
0
文件: __init__.py 项目: JGoutin/nun
def download(resources, output=".", debug=False, force=False):
    """
    Download resources.

    Args:
        resources (iterable of str): Resources URLs.
        output (path-like object): Output path.
        debug (bool): If True, show full error traceback and stop on first error.
        force (bool): Replace any existing destination even if modified by user.
    """
    with _Tsk(resources, "download", output=output, debug=debug, force=force) as tsk:
        tsk.apply()