fix list-repo-token

This commit is contained in:
Alnus Tmp 2021-12-19 19:14:19 -05:00
parent 7abe6a3097
commit 0c8b87734a
1 changed files with 5 additions and 3 deletions

View File

@ -41,7 +41,6 @@ def listRepos(provider_git, team_org, verbose = False):
response = requests.get(page_url)
page_json = response.json()
repos = {}
print(page_url)
if provider_git == 'bitbucket':
while page_url is not None:
response = requests.get(page_url)
@ -131,6 +130,7 @@ class Gitea():
except Not_Connect:
print("Fail")
@click.command()
@click.option('--provider_git',
type=click.Choice([*__provider_git],
@ -145,11 +145,13 @@ def list_repo(provider_git, team_org, verbose):
@click.option('--domain', required=True)
@click.option('--team_org', required=True)
@click.option('--access_token', default=None)
def list_repo_token(domain, team_org, access_token):
@click.option('--verbose', default=False)
def list_repo_token(domain, team_org,
access_token, verbose):
HOST = "https://%s/api/v1" % (domain)
HEADERS = { "accept": "application/json", "content-type": "application/json" }
HEADERS["Authorization"] = "token %s" % (access_token)
Gitea.listRepo(host = HOST, team = team_org, headers = HEADERS)
Gitea.listRepo(HOST, team_org, HEADERS, verbose)
@click.command()
@click.option('--domain', required=True)