Ver código fonte

update

tags/3.1_alpha
Manuel83 8 anos atrás
pai
commit
ad21625f9b
1 arquivos alterados com 14 adições e 5 exclusões
  1. +14
    -5
      gittest.py

+ 14
- 5
gittest.py Ver arquivo

@@ -2,17 +2,26 @@ import requests
from git import Repo, Git

repo = Repo('./')
print repo
for remote in repo.remotes:
branch = repo.active_branch

print branch.name

for remote in repo.remotes:
remote.fetch()

url = 'https://api.github.com/repos/manuel83/craftbeerpi3/releases'
response = requests.get(url)

result = []

result = {"branches":[], "releases": []}

result["branches"].append({"name": "master"})

for branch in repo.branches:
result["branches"].append({"name": branch.name})

for r in response.json():
result.append({"tag_name": r.get("tag_name"), "timestamp": r.get("created_at")})
result["releases"].append({"name": "tags/%s" % r.get("tag_name")})

print result

print result

Carregando…
Cancelar
Salvar