mirror of
https://github.com/Manuel83/craftbeerpi3
synced 2026-11-03 20:53:54 +01:00
update
This commit is contained in:
+13
-4
@@ -2,17 +2,26 @@ import requests
|
|||||||
from git import Repo, Git
|
from git import Repo, Git
|
||||||
|
|
||||||
repo = Repo('./')
|
repo = Repo('./')
|
||||||
print repo
|
branch = repo.active_branch
|
||||||
for remote in repo.remotes:
|
|
||||||
|
|
||||||
|
print branch.name
|
||||||
|
|
||||||
|
for remote in repo.remotes:
|
||||||
remote.fetch()
|
remote.fetch()
|
||||||
|
|
||||||
url = 'https://api.github.com/repos/manuel83/craftbeerpi3/releases'
|
url = 'https://api.github.com/repos/manuel83/craftbeerpi3/releases'
|
||||||
response = requests.get(url)
|
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():
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user