mirror of
https://github.com/varunsridharan/github-gitea-mirror.git
synced 2024-09-11 17:56:39 +03:00
Updated
This commit is contained in:
parent
4381235e78
commit
9478eeb981
@ -26,7 +26,7 @@ def gistsSource():
|
||||
repo_owner = repo.owner.login
|
||||
|
||||
if gitea_uid == 'failed':
|
||||
gitea_uid = giteaCreateOrg(repo.owner.login)
|
||||
gitea_uid = giteaCreateUserOrOrg(repo.owner.login,repo.owner.type)
|
||||
|
||||
if gitea_uid == 'failed':
|
||||
gitea_uid = default_gist_user
|
||||
|
@ -26,7 +26,7 @@ def gistsStared():
|
||||
repo_owner = repo.owner.login
|
||||
|
||||
if gitea_uid == 'failed':
|
||||
gitea_uid = giteaCreateOrg(repo.owner.login)
|
||||
gitea_uid = giteaCreateUserOrOrg(repo.owner.login,repo.owner.type)
|
||||
|
||||
if gitea_uid == 'failed':
|
||||
gitea_uid = default_gist_user
|
||||
@ -58,6 +58,7 @@ def gistsStared():
|
||||
topics.append('public-gist')
|
||||
topics.append('public-{0}-gist'.format(repo_owner))
|
||||
giteaSetRepoTopics(repo_owner,m["repo_name"],topics)
|
||||
giteaSetRepoStar(repo_owner,m["repo_name"])
|
||||
|
||||
if status == 'failed':
|
||||
print(repo)
|
||||
|
@ -42,6 +42,7 @@ def giteaSetRepoTopics(owner,repo_name,topics):
|
||||
print(' ---> Success : Repository Topics Set')
|
||||
else:
|
||||
print(' ---> Error : Unable To SetRepository Topics')
|
||||
print(r.text,json.dumps(m))
|
||||
|
||||
def giteaSetRepoStar(owner,repo_name,topics):
|
||||
r = session.put(giteaHost("user/starred/{0}/{1}/".format(owner,repo_name)))
|
||||
|
@ -22,7 +22,7 @@ def repositoryForked():
|
||||
gitea_uid = giteaGetUser(gitea_dest_user)
|
||||
|
||||
if gitea_uid == 'failed':
|
||||
gitea_uid = giteaCreateOrg(gitea_dest_user)
|
||||
gitea_uid = giteaCreateUserOrOrg(gitea_dest_user,repo.owner.type)
|
||||
|
||||
repo_name = "{0}".format(real_repo)
|
||||
|
||||
@ -35,11 +35,13 @@ def repositoryForked():
|
||||
"uid" : gitea_uid,
|
||||
}
|
||||
|
||||
status = giteaCreateRepo(m,repo.private)
|
||||
if status != 'failed':
|
||||
topics = repo.get_topics()
|
||||
giteaSetRepoTopics(repo_owner,repo_name,topics)
|
||||
else:
|
||||
print(repo)
|
||||
status = giteaCreateRepo(m,repo.private)
|
||||
if status != 'failed':
|
||||
topics = repo.get_topics()
|
||||
topics.append('forked-repo')
|
||||
topics.append('forked-{0}-repo'.format(repo_owner))
|
||||
giteaSetRepoTopics(repo_owner,repo_name,topics)
|
||||
else:
|
||||
print(repo)
|
||||
|
||||
print(" ")
|
||||
print(" ")
|
@ -22,7 +22,7 @@ def repositorySource():
|
||||
gitea_uid = giteaGetUser(gitea_dest_user)
|
||||
|
||||
if gitea_uid == 'failed':
|
||||
gitea_uid = giteaCreateOrg(gitea_dest_user)
|
||||
gitea_uid = giteaCreateUserOrOrg(gitea_dest_user,repo.owner.type)
|
||||
|
||||
repo_name = "{0}".format(real_repo)
|
||||
|
||||
|
@ -40,7 +40,7 @@ def repositoryStared():
|
||||
topics.append('starred-repo')
|
||||
topics.append('starred-{0}-repo'.format(repo_owner))
|
||||
giteaSetRepoTopics(repo_owner,repo_name,topics)
|
||||
giteaSetRepoStar(repo_owner,repo_name,topics)
|
||||
giteaSetRepoStar(repo_owner,repo_name)
|
||||
else:
|
||||
print(repo)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user