当前位置: 首页>>代码示例>>Python>>正文


Python QueuedLoader.start方法代码示例

本文整理汇总了Python中acdcli.utils.threading.QueuedLoader.start方法的典型用法代码示例。如果您正苦于以下问题:Python QueuedLoader.start方法的具体用法?Python QueuedLoader.start怎么用?Python QueuedLoader.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在acdcli.utils.threading.QueuedLoader的用法示例。


在下文中一共展示了QueuedLoader.start方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: download_action

# 需要导入模块: from acdcli.utils.threading import QueuedLoader [as 别名]
# 或者: from acdcli.utils.threading.QueuedLoader import start [as 别名]
def download_action(args: argparse.Namespace) -> int:
    excl_re = regex_helper(args)

    jobs = []
    ret_val = 0
    ret_val |= create_dl_jobs(args.node, args.path, excl_re, jobs)

    ql = QueuedLoader(args.max_connections, max_retries=args.max_retries)
    ql.add_jobs(jobs)

    return ret_val | ql.start()
开发者ID:bsnipes,项目名称:acd_cli,代码行数:13,代码来源:acd_cli.py

示例2: overwrite_action

# 需要导入模块: from acdcli.utils.threading import QueuedLoader [as 别名]
# 或者: from acdcli.utils.threading.QueuedLoader import start [as 别名]
def overwrite_action(args: argparse.Namespace) -> int:
    if not os.path.isfile(args.file):
        logger.error('Invalid file.')
        return INVALID_ARG_RETVAL

    prog = progress.FileProgress(os.path.getsize(args.file))
    ql = QueuedLoader(max_retries=args.max_retries)
    job = partial(overwrite, args.node, args.file, pg_handler=prog)
    ql.add_jobs([job])

    return ql.start()
开发者ID:bsnipes,项目名称:acd_cli,代码行数:13,代码来源:acd_cli.py

示例3: upload_stream_action

# 需要导入模块: from acdcli.utils.threading import QueuedLoader [as 别名]
# 或者: from acdcli.utils.threading.QueuedLoader import start [as 别名]
def upload_stream_action(args: argparse.Namespace) -> int:
    if not cache.get_node(args.parent):
        logger.critical('Invalid upload folder')
        return INVALID_ARG_RETVAL

    prog = progress.FileProgress(0)
    ql = QueuedLoader(max_retries=0)
    job = partial(upload_stream,
                  sys.stdin.buffer, args.name, args.parent, args.deduplicate, pg_handler=prog)
    ql.add_jobs([job])

    return ql.start()
开发者ID:bsnipes,项目名称:acd_cli,代码行数:14,代码来源:acd_cli.py

示例4: upload_action

# 需要导入模块: from acdcli.utils.threading import QueuedLoader [as 别名]
# 或者: from acdcli.utils.threading.QueuedLoader import start [as 别名]
def upload_action(args: argparse.Namespace) -> int:
    excl_re = regex_helper(args)

    jobs = []
    ret_val = 0
    for path in args.path:
        if not os.path.exists(path):
            logger.error('Path "%s" does not exist.' % path)
            ret_val |= INVALID_ARG_RETVAL
            continue

        ret_val |= create_upload_jobs(path, args.parent, args.overwrite, args.force, args.deduplicate, excl_re, jobs)

    ql = QueuedLoader(args.max_connections, max_retries=args.max_retries)
    ql.add_jobs(jobs)

    return ret_val | ql.start()
开发者ID:theoryno3,项目名称:acd_cli,代码行数:19,代码来源:acd_cli.py

示例5: upload_action

# 需要导入模块: from acdcli.utils.threading import QueuedLoader [as 别名]
# 或者: from acdcli.utils.threading.QueuedLoader import start [as 别名]
def upload_action(args: argparse.Namespace) -> int:
    if not cache.get_node(args.parent):
        logger.critical('Invalid upload folder.')
        return INVALID_ARG_RETVAL

    excl_re = regex_helper(args)

    jobs = []
    ret_val = 0
    for path in args.path:
        if not os.path.exists(path):
            logger.error('Path "%s" does not exist.' % path)
            ret_val |= INVALID_ARG_RETVAL
            continue

        ret_val |= create_upload_jobs([], path, args.parent, args.overwrite, args.force,
                                      args.deduplicate, args.remove_source_files,
                                      excl_re, args.exclude_path, jobs)

    ql = QueuedLoader(args.max_connections, max_retries=args.max_retries)
    ql.add_jobs(jobs)

    return ret_val | ql.start()
开发者ID:zmwangx,项目名称:acd_cli,代码行数:25,代码来源:acd_cli.py


注:本文中的acdcli.utils.threading.QueuedLoader.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。