mirror of
https://github.com/varunsridharan/github-gitea-mirror.git
synced 2024-09-11 17:56:39 +03:00
Added TryCache Method Test#1
This commit is contained in:
parent
1b9d6529e2
commit
ca2927d5ba
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
# https://github.com/PyGithub/PyGithub
|
||||
from helper import log,getConfig,giteaSetRepoTopics,giteaSession,giteaSetRepoStar,giteaCreateRepo,ghApi,giteaCreateUserOrOrg,giteaGetUser,config
|
||||
from github import GithubException
|
||||
|
||||
def repositoryStared():
|
||||
config = getConfig()
|
||||
@ -36,11 +37,14 @@ def repositoryStared():
|
||||
|
||||
status = giteaCreateRepo(m,repo.private)
|
||||
if status != 'failed':
|
||||
topics = repo.get_topics()
|
||||
topics.append('starred-repo')
|
||||
topics.append('starred-{0}-repo'.format(repo_owner))
|
||||
giteaSetRepoTopics(repo_owner,repo_name,topics)
|
||||
giteaSetRepoStar(repo_owner,repo_name)
|
||||
try:
|
||||
topics = repo.get_topics()
|
||||
topics.append('starred-repo')
|
||||
topics.append('starred-{0}-repo'.format(repo_owner))
|
||||
giteaSetRepoTopics(repo_owner,repo_name,topics)
|
||||
giteaSetRepoStar(repo_owner,repo_name)
|
||||
except GithubException as e:
|
||||
print(e)
|
||||
else:
|
||||
log(repo)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user