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


Python Repository.handle_update方法代码示例

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


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

示例1: int

# 需要导入模块: from repository import Repository [as 别名]
# 或者: from repository.Repository import handle_update [as 别名]
    logging.debug("buildfarm mode: create new jobs")
    if (len(config.get('repository-url')) == 0):
        logging.error("Error: No repository url specified")
        sys.exit(1)

    log_data = copy.deepcopy(all_log_data)
    log_data['is_buildfarm'] = True
    log_data['repository'] = config.get('repository-url')
    log_data['start_time'] = int(time.time())
    current_time = time.strftime("%Y-%m-%d_%H%M%S", time.localtime(log_data['start_time']))
    log_data['start_time_local'] = current_time

    # from here on, only one repository is possible
    # create a repository instance
    repository = Repository(config, database, config.get('repository-url'), config.get('cache-dir'))
    repository.handle_update(True, log_data)
    # from here on a local copy of the repository is available

    # create a list of all jobs
    jobs = []
    for branch in config.get('build-branch'):
        job = {}
        job['added_ts'] = int(time.time())
        job['repository'] = config.get('repository-url')
        job['repository_type'] = repository.repository_type
        job['branch'] = branch
        if (config.get('build-revision') == 'HEAD'):
            job['revision'] = repository.repository_head(repository.full_path, branch)
            job['is_head'] = True
        else:
            job['revision'] = config.get('build-revision')
开发者ID:andreasscherbaum,项目名称:buildfarm-client,代码行数:33,代码来源:buildclient.py


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