您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

28 行
540B

  1. import requests
  2. from git import Repo, Git
  3. repo = Repo('./')
  4. branch = repo.active_branch
  5. print branch.name
  6. for remote in repo.remotes:
  7. remote.fetch()
  8. url = 'https://api.github.com/repos/manuel83/craftbeerpi3/releases'
  9. response = requests.get(url)
  10. result = {"branches":[], "releases": []}
  11. result["branches"].append({"name": "master"})
  12. for branch in repo.branches:
  13. result["branches"].append({"name": branch.name})
  14. for r in response.json():
  15. result["releases"].append({"name": "tags/%s" % r.get("tag_name")})
  16. print result