mirror of
https://github.com/varunsridharan/github-gitea-mirror.git
synced 2024-09-11 17:56:39 +03:00
Improved.
This commit is contained in:
parent
9478eeb981
commit
3d11706fb9
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
# https://github.com/PyGithub/PyGithub
|
||||
from helper import getConfig, giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser
|
||||
from helper import getConfig,giteaCreateUserOrOrg, giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser
|
||||
|
||||
def gistsSource():
|
||||
config = getConfig()
|
||||
@ -49,7 +49,7 @@ def gistsSource():
|
||||
|
||||
status = giteaCreateRepo(m,isPrivate)
|
||||
|
||||
if status == 'created':
|
||||
if status != 'failed':
|
||||
topics = ['gist','{0}-gist'.format(repo_owner)]
|
||||
if isPrivate:
|
||||
topics.append('secret-gist')
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
# https://github.com/PyGithub/PyGithub
|
||||
from helper import getConfig, giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser
|
||||
from helper import getConfig,giteaCreateUserOrOrg,giteaSetRepoStar, giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser
|
||||
|
||||
def gistsStared():
|
||||
config = getConfig()
|
||||
@ -49,7 +49,7 @@ def gistsStared():
|
||||
|
||||
status = giteaCreateRepo(m,isPrivate)
|
||||
|
||||
if status == 'created':
|
||||
if status != 'failed':
|
||||
topics = ['gist','{0}-gist'.format(repo_owner),'gist-stared','{0}-stared-gist'.format(repo_owner)]
|
||||
if isPrivate:
|
||||
topics.append('secret-gist')
|
||||
|
@ -44,7 +44,7 @@ def giteaSetRepoTopics(owner,repo_name,topics):
|
||||
print(' ---> Error : Unable To SetRepository Topics')
|
||||
print(r.text,json.dumps(m))
|
||||
|
||||
def giteaSetRepoStar(owner,repo_name,topics):
|
||||
def giteaSetRepoStar(owner,repo_name):
|
||||
r = session.put(giteaHost("user/starred/{0}/{1}/".format(owner,repo_name)))
|
||||
|
||||
if r.status_code == 204:
|
||||
|
@ -10,7 +10,7 @@ config = getConfig()
|
||||
|
||||
if config['gistsSource']:
|
||||
print('Setting Up Mirror For Source Github Gists')
|
||||
gistsSource()
|
||||
#gistsSource()
|
||||
|
||||
if config['gistsStared']:
|
||||
print('Setting Up Mirror For Stared Github Gists')
|
||||
@ -18,12 +18,12 @@ if config['gistsStared']:
|
||||
|
||||
if config['repositorySource']:
|
||||
print('Setting Up Mirror For Source Github Repository')
|
||||
repositorySource()
|
||||
#repositorySource()
|
||||
|
||||
if config['repositoryStared']:
|
||||
print('Setting Up Mirror For Stared Github Repository')
|
||||
repositoryStared()
|
||||
#repositoryStared()
|
||||
|
||||
if config['repositoryForked']:
|
||||
print('Setting Up Mirror For Forked Github Repository')
|
||||
repositoryForked()
|
||||
#repositoryForked()
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
# https://github.com/PyGithub/PyGithub
|
||||
from helper import getConfig,giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser,config
|
||||
from helper import getConfig,giteaCreateUserOrOrg,giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser,config
|
||||
|
||||
def repositoryForked():
|
||||
config = getConfig()
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
# https://github.com/PyGithub/PyGithub
|
||||
from helper import getConfig,giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser,config
|
||||
from helper import getConfig,giteaCreateUserOrOrg,giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser,config
|
||||
|
||||
def repositorySource():
|
||||
config = getConfig()
|
||||
|
Loading…
Reference in New Issue
Block a user