當前位置: 首頁>>代碼示例>>Python>>正文


Python TravisPy.builds方法代碼示例

本文整理匯總了Python中travispy.TravisPy.builds方法的典型用法代碼示例。如果您正苦於以下問題:Python TravisPy.builds方法的具體用法?Python TravisPy.builds怎麽用?Python TravisPy.builds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在travispy.TravisPy的用法示例。


在下文中一共展示了TravisPy.builds方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: stop_all_builds

# 需要導入模塊: from travispy import TravisPy [as 別名]
# 或者: from travispy.TravisPy import builds [as 別名]
def stop_all_builds():
  for username, repo_name, github_token, travis_ci_token in CREDS:
    travis_session = TravisPy(token=travis_ci_token)
    builds = travis_session.builds(slug="{}/{}".format(username, repo_name))
    for build in builds:
      if not build.finished:
        success = build.cancel()
        url = calculate_build_url(username, repo_name, build)
        if success:
          logger.info("Build {} aborted".format(url))
        else:
          logger.error("Build {} fails to abort".format(url))
開發者ID:wisechengyi,項目名稱:TPlumber,代碼行數:14,代碼來源:exploit_travis.py

示例2: main

# 需要導入模塊: from travispy import TravisPy [as 別名]
# 或者: from travispy.TravisPy import builds [as 別名]
def main():
    travis = TravisPy()
    revision = check_output(["git", "rev-parse", "HEAD"]).strip()
    build_passed = False
    for build in travis.builds(slug="datawire/mdk"):
        if build.commit.sha == revision:
            if build.passed:
                build_passed = True
                break
            else:
                error("Found the build but it has not passed.\n    Build state: "
                      + build.state +
                      "\n    Build URL: https://travis-ci.org/datawire/mdk/builds/"
                      + str(build.id))

    if not build_passed:
        error("No matching build found on Travis CI.")
開發者ID:datawire,項目名稱:mdk,代碼行數:19,代碼來源:check-travis.py

示例3: TravisPy

# 需要導入模塊: from travispy import TravisPy [as 別名]
# 或者: from travispy.TravisPy import builds [as 別名]
	'grosser/parallel_tests',
	'mongodb/mongo-python-driver',
	'scambra/devise_invitable',
	'dennisreimann/ioctocat',
	'cython/cython',
	'mongomapper/mongomapper',
	'publify/publify'	
]

t = TravisPy()

builds_result = []

for project in projects:

	builds = t.builds(slug=project, event_type='pull_request')

	labels = ['project', 'pull_number', 'started_at', 'finished_at', 'branch', 'build_status']
	count = 1

	print ' {:_<6} {:_<26} {:_^12} {:_^8} {:_^8} '.format('','','','','')
	print '|{:^6}|{:^26}|{:^12}|{:^8}|{:^8}|'.format('#','project','pull_number', 'branch', 'status')

	while builds:
		for build in builds:
			print '|{:_<6}|{:_<26}|{:_^12}|{:_^8}|{:_^8}|'.format('','','','','')
			print '|{:^6}|{:^26}|{:^12}|{:^8}|{:^8}|'.format(count, project, build.pull_request_number, build.commit.branch, build.color)

			data = [project, build.pull_request_number, 
					build.started_at, build.finished_at, build.commit.branch, build.color]
開發者ID:joaohelis,項目名稱:pulls_analysis,代碼行數:32,代碼來源:travis_miner.py


注:本文中的travispy.TravisPy.builds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。